Skip to main content

A way of writing CSS with a Python library.

Project description

CSS.py

A simple way of making CSS code in Python.

Your CSS.py installation

Installing CSS.py

pip install cssdotpy

Updating CSS.py

pip install --upgrade cssdotpy

Links

Using it

NOTICE: CSS.PY IS IN ALPHA DEVELOPMENT STAGES AND DOES NOT HAVE MANY FEATURES YET

Creating a CSS instance

import cssdotpy

MyCSS = cssdotpy.CSS()

Adding HTML elements to the CSS and styling them

import cssdotpy

MyCSS = cssdotpy.CSS()

MyCSS.addElement(element="p", style=["color:red", "font-family:roboto"])

Adding HTML classes to the CSS and styling them

import cssdotpy

MyCSS = cssdotpy.CSS()

MyCSS.addClass(name="MyClassName", style=["color:red", "font-family:roboto"])

Adding Events to elements and/or classes and styling those

import cssdotpy

MyCSS = cssdotpy.CSS()

MyCSS.addElement(element="p", style=["color:red", "font-family:roboto"])
MyCSS.addClass(name="MyClassName", style=["color:red", "font-family:roboto"])

MyCSS.addEventToElement(element="p", event="hover", style=["color:blue", "transform: scale(1.1)"])
MyCSS.addEventToClass(name="MyClassName", event="hover", style=["color:blue", "transform: scale(1.1)"])

Getting your CSS

import cssdotpy

MyCSS = cssdotpy.CSS()

MyCSS.addElement(element="p", style=["color:red", "font-family:roboto"])
MyCSS.addClass(name="MyClassName", style=["color:red", "font-family:roboto"])

MyCSS.addEventToElement(element="p", event="hover", style=["color:blue", "transform: scale(1.1)"])
MyCSS.addEventToClass(name="MyClassName", event="hover", style=["color:blue", "transform: scale(1.1)"])

# Print CSS
print(MyCSS.returnCSS())

# Output to file
open("output.css", "w").write(MyCSS.returnCSS())

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

CSSdotPy-0.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file CSSdotPy-0.1-py3-none-any.whl.

File metadata

  • Download URL: CSSdotPy-0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for CSSdotPy-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 853020f5a18745a79dbf6b719d222b55104a9cac331f6cec63d0014309bbb53b
MD5 f1bd66386975fa0846387cdcdc4e6e0c
BLAKE2b-256 8039fb13ce57c620aef8e7ba8d5f639157bb9849237efce2e8da9b0f00318801

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page