Represents CSS properties.
The Style class is responsible for handling and storing CSS properties. It includes methods to resolve colours and lengths, as well as getters & setters for many CSS properites.
Actual CSS parsing is performed in the Stylesheet class.
Located in /include/style.cls.php (line 53)
List of all block types. Should really be a constant.
List of valid border styles. Should also really be a constant.
Default font size, in points.
Default line height, as a fraction of the font size.
List of all inline types. Should really be a constant.
List of all table types. Should really be a constant.
Default style values.
List of inherited properties
Font size of parent element in document tree. Used for relative font size resolution.
Main array of all CSS properties & values
The stylesheet this style belongs to
Class constructor
Returns the background colour as an array
The returned array has the same format as Style::get_color()
Returns the background position as an array
The returned array has the following format:
- array(x,y, "x" => x, "y" => y)
Return full border properties as a string
Border properties are returned just as specified in CSS:
[width] [style] [color]e.g. "1px solid blue"
Returns the border colour as an array
Returns the border width, as it is currently stored
Return full border properties as a string
Border properties are returned just as specified in CSS:
[width] [style] [color]e.g. "1px solid blue"
Returns the border colour as an array
Returns the border width, as it is currently stored
Return an array of all border properties.
The returned array has the following structure:
- array("top" => array("width" => [border-width],
- "style" => [border-style],
- "color" => [border-color (array)]),
- "bottom" ... )
Return full border properties as a string
Border properties are returned just as specified in CSS:
[width] [style] [color]e.g. "1px solid blue"
Returns the border colour as an array
Returns the border width, as it is currently stored
Returns border spacing as an array
The array has the format (h_space,v_space)
Return full border properties as a string
Border properties are returned just as specified in CSS:
[width] [style] [color]e.g. "1px solid blue"
Returns the border colour as an array
Returns the border width, as it is currently stored
Returns the colour as an array
The array has the following format:
- array(r,g,b, "r" => r, "g" => g, "b" => b, "hex" => "#rrggbb")
Getter for the 'font-family' CSS property.
Uses the Font_Metrics class to resolve the font family into an actual font file.
Returns the resolved font size, in points
returns the Stylesheet this Style is associated with.
Set inherited properties in this style using values in $parent
Converts any CSS length value into an absolute length in points.
length_in_pt() takes a single length (e.g. '1em') or an array of lengths and returns an absolute length. If an array is passed, then the return value is the sum of all elements.
If a reference size is not provided, the default font size is used (Style::$default_font_size).
Override properties in this style with those in $style
Alias for Style::munge_colour()
Returns an array(r, g, b, "r"=> r, "g"=>g, "b"=>b, "hex"=>"#rrggbb") based on the provided CSS colour value.
Sets the background colour
Sets the border styles
Sets the border styles
Sets the border styles
Sets the border styles
Sets the border styles
Sets the border spacing
Sets the border styles
Sets the border styles
Sets the border styles
Sets colour
The colour parameter can be any valid CSS colour value
Sets the font size
$size can be any acceptable CSS size
Sets the list style
This is not currently implemented
Sets the margin size
Sets the margin size
Sets the margin size
Sets the margin size
Sets the margin size
Sets the padding size
Sets the padding size
Sets the padding size
Sets the padding size
Sets the padding size
Sets page break properties
Sets page break properties
Return a single border property
Sets a single border
PHP5 overloaded getter
Along with Style::__set() __get() provides access to all CSS properties directly. Typically __get() is not called directly outside of this class.
PHP5 overloaded setter
This function along with Style::__get() permit a user of the Style class to access any (CSS) property using the following syntax:
__set() automatically calls the provided set function, if one exists, otherwise it sets the property directly. Typically, __set() is not called directly from outside of this class.
Generate a string representation of the Style
This dumps the entire property array into a string via print_r. Useful for debugging.
Documentation generated on Fri, 04 Mar 2005 13:31:19 -0700 by phpDocumentor 1.3.0RC3