Skip to content

A way of getting a ruleset by element/class #5

Open
arski opened this Issue Aug 30, 2013 · 2 comments

2 participants

@arski
arski commented Aug 30, 2013

Hi there, just wondering if you ever considered something that could help one get the styles for a certain element and/or class from the list of rules.. say if I have a parsed stylesheet, and want to know what styles would apply to ".foo" or "p#bar" - even at a very crude level of exact matching, without any inheritance, overwriting etc..

Cheers

@SimonSapin
Owner

No. This is out of scope for a parser. But you might want to have a look at cssselect as well as how to use it with tinycss.

@SimonSapin
Owner

See also how WeasyPrint implements the full CSS cascade based on cssselect and tinycss, or how CairoSVG does it somewhat simplified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.