$css
$css : array
Saves the parsed CSS. This array is empty if preserve_css is on.
CSS Parser class
This class represents a CSS parser which reads CSS code and saves it in an array. In opposite to most other CSS parsers, it does not use regular expressions and thus has full CSS2 support and a higher reliability. Additional to that it applies some optimisations and fixes to the CSS code. An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php
write_page(string $filename, string $doctype, bool $externalcss, string $title, string $lang)
Write formatted output to a file
string | $filename | |
string | $doctype | when printing formatted, is a shorthand for the document type |
bool | $externalcss | when printing formatted, indicates whether styles to be attached internally or as an external stylesheet |
string | $title | when printing formatted, is the title to be added in the head of the document |
string | $lang | when printing formatted, gives a two-letter language code to be added to the output |
write(string $filename, bool $formatted, string $doctype, bool $externalcss, string $title, string $lang, bool $pre_code)
Write plain output to a file
string | $filename | |
bool | $formatted | whether to print formatted or not |
string | $doctype | when printing formatted, is a shorthand for the document type |
bool | $externalcss | when printing formatted, indicates whether styles to be attached internally or as an external stylesheet |
string | $title | when printing formatted, is the title to be added in the head of the document |
string | $lang | when printing formatted, gives a two-letter language code to be added to the output |
bool | $pre_code | whether to add pre and code tags around the code (for light HTML formatted templates) |
load_template(string $content, bool $from_file)
Loads a new template
string | $content | either filename (if $from_file == true), content of a template file, "high_compression", "highest_compression", "low_compression", or "default" |
bool | $from_file | uses $content as filename if true |
css_new_selector(string $media, string $selector) : string
Start a new selector.
If already referenced in this media section, rename it with extra space to avoid merging except if merging is required, or last selector is the same (merge siblings)
never merge @font-face
string | $media | |
string | $selector |
parse_string_list( $value) : array
Accepts a list of strings (e.g., the argument to format() in a @font-face src property) and returns a list of the strings. Converts things like:
format(abc) => format("abc") format(abc def) => format("abc","def") format(abc "def") => format("abc","def") format(abc, def, ghi) => format("abc","def","ghi") format("abc",'def') => format("abc","def") format("abc, def, ghi") => format("abc, def, ghi")
$value |