PyKSS is a Python implementation of KSS. KSS attempts to provide a methodology for writing maintainable, documented CSS within a team.
The official docs provide a good introduction to KSS. The complete syntax can he found on the syntax page.
Installing
pip install pykss
Usage
>>> import pykss
>>>
>>> styleguide = pykss.Parser('static/css')
>>>
>>> styleguide.section('2.1.1')
<pykss.section.Section object at 0x10c1d1190>
>>>
>>> styleguide.section('2.1.1').description
'A button suitable for giving stars to someone.'
>>>
>>> styleguide.section('2.1.1').modifiers[0]
<pykss.modifier.Modifier object at 0x10c1d1290>
>>>
>>> styleguide.section('2.1.1').modifiers[0].name
':hover'
>>>
>>> styleguide.section('2.1.1').modifiers[0].class_name
'pseudo-class-hover'
>>>
>>> styleguide.section('2.1.1').modifiers[0].description
'Subtle hover highlight'
Django Usage
If you would like to use KSS within a Django project pykss.contrib.django provides a view and template tag to make it easier. Check out the example Django project for usage.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pykss-0.2.7.tar.gz
(8.1 kB
view details)
File details
Details for the file pykss-0.2.7.tar.gz.
File metadata
- Download URL: pykss-0.2.7.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b15d88e23f305c0f8c65603689a5c359e27608c848a1d47578003ef59776cb41
|
|
| MD5 |
4824a6f4ea02e42919e26f5e107936ca
|
|
| BLAKE2b-256 |
4417ff7f8f928a898f2079bf38453450a3931e49a3e823b61126cf4b8f777f92
|