A simple way of making CSS code in Python.
pip install cssdotpy
pip install --upgrade cssdotpy
import cssdotpy
MyCSS = cssdotpy.CSS()
import cssdotpy
MyCSS = cssdotpy.CSS()
MyCSS.addElement(element="p", style=["color:red", "font-family:roboto"])
import cssdotpy
MyCSS = cssdotpy.CSS()
MyCSS.addClass(name="MyClassName", style=["color:red", "font-family:roboto"])
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)"])
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())