Add the following functionality to CSSTidy:
ability to import a CSS file which has @import calls to other CSS files and treat all selectors as if they exist in the main CSS file
So, if main.css contains the following code:
Code: Select all
@import url('../styles/global/reset.css');
@import url('/styles/themes/helloWorld/structure.css');
@import url('/styles/themes/helloWorld/presentation.css');I found PHP-CSS-Parser. The Documentation says to:
I believe this is how i need to start:To access the items stored in a CSSList – like the document you got back when calling $oCssParser->parse() –, use getContents(), then iterate over that collection and use instanceof to check whether you’re dealing with another CSSList, a CSSRuleSet, a CSSImport or a CSSCharset.
Code: Select all
$oCssParser = new CSSParser(file_get_contents('main.css'));
$oCssDocument = $oCssParser->parse();
getContents($oCssDocument);