Spaces:
No application file
No application file
|
Download readme/extensions/style.md from mrtroydev/audio-webui: direct link, hf CLI and curl.
- Browser
- Download file 979 Bytes
-
https://huggingface.co/spaces/mrtroydev/audio-webui/resolve/main/readme/extensions/style.md
- Command line
-
hf download hf://spaces/mrtroydev/audio-webui/readme/extensions/style.md
-
curl -L -o style.md https://huggingface.co/spaces/mrtroydev/audio-webui/resolve/main/readme/extensions/style.md
979 Bytes
| # SimpleStyle | |
| ## What is it? | |
| SimpleStyle is a simple way to write css in python, it allows you to give your styles a priority compared to other | |
| SimpleStyle scripts. It uses `__enter__` and `__exit__` to allow for easy styling, in a readable way for python. | |
| If you have any suggestions or issues, please create an issue or send a message on discord. | |
| ## Example | |
| Example CSS: | |
| ```css | |
| .classname:not(.classname2) { | |
| border: 1px solid black; | |
| position: relative; | |
| } | |
| #id { | |
| color: white; | |
| } | |
| ``` | |
| SimpleStyle equivalent: | |
| ```python | |
| from simplestyle.manager import SimpleStyle, StyleRule, StyleValue | |
| with SimpleStyle(priority=0): # 0 is default, higher is later | |
| with StyleRule('.classname:not(.classname2)'): # Selector | |
| StyleValue('border', '1px solid black') # Value | |
| StyleValue('position', 'relative') | |
| with StyleRule('#id'): | |
| StyleValue('color', 'white') | |
| ``` | |
| (Make sure to put your style code in extension/**style.py** for it to be recognised) | |