A few utility functions which may help when working with CSS stylesheets.
Retrieve all url(urlstring) values (in e.g. cssutils.css.CSSImportRule or cssutils.css.CSSValue objects of given sheet.
Parameters: | sheet – cssutils.css.CSSStyleSheet object whose URLs are yielded |
---|
This function is a generator. The generated URL values exclude url( and ) and surrounding single or double quotes.
Replace all URLs in cssutils.css.CSSImportRule or cssutils.css.CSSValue objects of given sheetOrStyle.
Parameters: |
|
---|
Recurcively combine all rules in given sheet into a target sheet. @import rules which use media information are tried to be wrapped into @media rules so keeping the media information. This may not work in all instances (if e.g. an @import rule itself contains an @import rule with different media infos or if it contains rules which may not be used inside an @media block like @namespace rules.). In these cases the @import rule is kept as in the original sheet and a WARNING is issued.
Parameters: |
|
---|---|
Returns: | given target or a new cssutils.css.CSSStyleSheet object |