Skip to content

BLUEAMETHYST-Studios/CSS.py

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())

About

A library for writing CSS code and then compiling it into default CSS.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors