Class csstidy
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
Author: Florian Schmitz (floele at gmail dot com) 2005-2006
Located at Horde/Text/Filter/Csstidy/class.csstidy.php
public
|
|
public
mixed
|
|
public
boolean
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
public
|
|
public
|
|
public
boolean
|
|
public
|
|
public
boolean
|
|
public
|
#
css_add_property( string $media, string $selector, string $property, string $new_val, string $selector_id = null )
Adds a property with value to the existing CSS code |
public
|
#
merge_css_blocks( string $media, string $selector, array $css_add )
Adds CSS to an existing media/selector |
public
boolean
|
|
public
string
|
|
public
boolean
|
#
property_is_next( string $istring, integer $pos )
Checks if the next word in a string from pos is a CSS property |
public
bool;
|
|
public
string
|
#
filterBySelector( array $input )
Filters CSS by a list of simple selectors and returns a string suitable for use in a HTML style attribute. |
public
array
|
$css
Saves the parsed CSS |
#
array()
|
public
array
|
$tokens
Saves the parsed CSS (raw) |
#
array()
|
public
object
|
$print
Printer class |
|
public
object
|
$optimise
Optimiser class |
|
public
string
|
$charset
Saves the CSS charset (@charset) |
#
''
|
public
array
|
$import
Saves all @import URLs |
#
array()
|
public
string
|
$namespace
Saves the namespace |
#
''
|
public
array
|
$settings
Stores the settings |
#
array()
|
public
string
|
$status
Saves the parser-status. |
#
'is'
|
public
string
|
$at
Saves the current at rule (@media) |
#
''
|
public
string
|
$selector
Saves the current selector |
#
''
|
public
string
|
$property
Saves the current property |
#
''
|
public
array
|
$sel_separate
Saves the position of , in selectors |
#
array()
|
public
string
|
$value
Saves the current value |
#
''
|
public
string
|
$sub_value
Saves the current sub-value |
#
''
|
public
array
|
$sub_value_arr
Array which saves all subvalues for a property. |
#
array()
|
public
string
|
$str_char
Saves the char which opened the last string |
#
''
|
public
string
|
$cur_string
|
#
''
|
public
string
|
$from
Status from which the parser switched to ic or instr |
#
''
|
public
string
|
$str_in_str
Variable needed to manage string-in-strings, for example url("foo.png") |
#
false
|
public
boolean
|
$invalid_at
=true if in invalid at-rule |
#
false
|
public
boolean
|
$added
=true if something has been added to the current selector |
#
false
|
public
array
|
$log
Array which saves the message log |
#
array()
|
public
integer
|
$line
Saves the line number |
#
1
|