Page MenuHomeDevCentral

Parse CSS

Authored By
dereckson
May 26 2023, 02:06
Size
265 B
Referenced Files
None
Subscribers
None

Parse CSS

import tinycss2
with open('data/SourceSansPro.css', "rb") as fd:
css = fd.read()
rules = tinycss2.parse_stylesheet_bytes(css)
print(rules)
print(rules[0])
print(rules[0][0])
print(rules[0][0].content)
for node in rules[0][0].content:
print(node)

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1400983
Default Alt Text
Parse CSS (265 B)

Event Timeline