Style
in package
Represents CSS properties.
The Style class is responsible for handling and storing CSS properties. It includes methods to resolve colors and lengths, as well as getters & setters for many CSS properites.
Table of Contents
- CSS_IDENTIFIER = "-?[_a-zA-Z]+[_a-zA-Z0-9-]*"
- CSS_INTEGER = "-?\d+"
- $_has_border_radius : bool
- $BLOCK_TYPES : array<string|int, mixed>
- List of all block types. Should really be a constant.
- $BORDER_STYLES : array<string|int, mixed>
- List of valid border styles. Should also really be a constant.
- $default_font_size : float
- Default font size, in points.
- $default_line_height : float
- Default line height, as a fraction of the font size.
- $font_size_keywords : array<string|int, float>
- Default "absolute" font sizes relative to the default font-size http://www.w3.org/TR/css3-fonts/#font-size-the-font-size-property
- $INLINE_TYPES : array<string|int, mixed>
- List of all inline types. Should really be a constant.
- $POSITIONNED_TYPES : array<string|int, mixed>
- List of all positionned types. Should really be a constant.
- $TABLE_TYPES : mixed
- List of all table types. Should really be a constant.
- $text_align_keywords : array<string|int, mixed>
- List of valid text-align keywords. Should also really be a constant.
- $vertical_align_keywords : array<string|int, mixed>
- List of valid vertical-align keywords. Should also really be a constant.
- $_defaults : array<string|int, mixed>
- Default style values.
- $_dependency_map : mixed
- $_frame : Frame
- $_important_props : mixed
- $_inherited : array<string|int, mixed>
- List of inherited properties
- $_media_queries : int
- Media queries attached to the style
- $_methods_cache : array<string|int, bool>
- Caches method_exists result
- $_origin : int
- The origin of the style
- $_parent_font_size : float
- Font size of parent element in document tree. Used for relative font size resolution.
- $_prop_cache : array<string|int, mixed>
- The used values of the CSS property
- $_props : array<string|int, mixed>
- Main array of all CSS properties & values
- $_props_computed : array<string|int, mixed>
- The computed values of the CSS property
- $_props_shorthand : array<string|int, mixed>
- List of CSS shorthand properties
- $_stylesheet : Stylesheet
- The stylesheet this style belongs to
- $_computed_border_radius : mixed
- The computed border radius
- $_computed_bottom_spacing : mixed
- The computed bottom spacing
- $fontMetrics : FontMetrics
- __construct() : mixed
- Class constructor
- __get() : mixed
- PHP5 overloaded getter Along with {@link Style::__set()} __get() provides access to all CSS properties directly. Typically __get() is not called directly outside of this class.
- __set() : mixed
- PHP5 overloaded setter
- __toString() : string
- Generate a string representation of the Style
- compute_props() : mixed
- Calculates the computed value of the CSS properties that have been set (the specified properties)
- computed_bottom_spacing() : float|null|string
- debug_print() : mixed
- dispose() : mixed
- "Destructor": forcibly free all references held by this object
- get_background_color() : array<string|int, mixed>
- Returns the background color as an array
- get_background_image() : string
- Returns the background image URI, or "none"
- get_background_position() : array<string|int, mixed>
- Returns the background position as an array
- get_background_size() : string|array<string|int, mixed>
- Returns the background size as an array
- get_border_bottom() : mixed
- get_border_bottom_color() : array<string|int, mixed>
- get_border_bottom_left_radius() : float|int|string
- get_border_bottom_right_radius() : float|int|string
- get_border_left() : mixed
- get_border_left_color() : array<string|int, mixed>
- get_border_properties() : array<string|int, mixed>
- Return an array of all border properties.
- get_border_right() : mixed
- get_border_right_color() : array<string|int, mixed>
- get_border_spacing() : array<string|int, mixed>
- Returns border spacing as an array
- get_border_top() : mixed
- get_border_top_color() : mixed
- get_border_top_left_radius() : float|int|string
- get_border_top_right_radius() : float|int|string
- get_color() : array<string|int, mixed>
- Returns the color as an array
- get_computed_border_radius() : array<string|int, mixed>|null
- get_counter_increment() : mixed
- get_font_family() : string
- Getter for the 'font-family' CSS property.
- get_font_family_raw() : string
- get_frame() : Frame
- get_letter_spacing() : float
- get_line_height() : float
- get_list_style_image() : string
- Returns the list style image URI, or "none"
- get_margin_bottom() : mixed
- get_margin_left() : mixed
- get_margin_right() : mixed
- get_margin_top() : mixed
- get_media_queries() : array<string|int, mixed>|int
- get_origin() : int
- get_outline() : mixed
- get_outline_color() : array<string|int, mixed>
- Returns the outline color as an array
- get_outline_width() : mixed
- get_padding_bottom() : mixed
- get_padding_left() : mixed
- get_padding_right() : mixed
- get_padding_top() : mixed
- get_prop() : string
- Similar to __get() without storing the result. Useful for accessing properties while loading stylesheets.
- get_stylesheet() : Stylesheet
- returns the {@link Stylesheet} this Style is associated with.
- get_transform() : array<string|int, mixed>|null
- Gets the CSS3 transform property
- get_transform_origin() : array<string|int, mixed>
- Gets the CSS3 transform-origin property
- get_word_spacing() : float
- getFontMetrics() : FontMetrics
- important_get() : bool
- important_set() : mixed
- inherit() : Style
- Set inherited properties in this style using values in $parent
- length_in_pt() : float|string
- Converts any CSS length value into an absolute length in points.
- merge() : mixed
- Override properties in this style with those in $style
- munge_color() : array<string|int, mixed>
- Returns an array(r, g, b, "r"=> r, "g"=>g, "b"=>b, "hex"=>"#rrggbb") based on the provided CSS color value.
- set__dompdf_background_image_resolution() : mixed
- set__dompdf_image_resolution() : mixed
- set__webkit_transform() : mixed
- set__webkit_transform_origin() : mixed
- set_background() : mixed
- Sets the background - combined options
- set_background_attachment() : mixed
- Sets the background attachment
- set_background_color() : mixed
- Sets the background color
- set_background_image() : mixed
- Set the background image url
- set_background_image_resolution() : mixed
- auto | normal | dpi
- set_background_position() : mixed
- Sets the background position
- set_background_repeat() : mixed
- Sets the background repeat
- set_background_size() : mixed
- Sets the background size
- set_border() : mixed
- set_border_bottom() : mixed
- set_border_bottom_color() : mixed
- set_border_bottom_left_radius() : mixed
- set_border_bottom_right_radius() : mixed
- set_border_bottom_style() : mixed
- set_border_bottom_width() : mixed
- set_border_color() : mixed
- set_border_left() : mixed
- set_border_left_color() : mixed
- set_border_left_style() : mixed
- set_border_left_width() : mixed
- set_border_radius() : mixed
- set_border_right() : mixed
- set_border_right_color() : mixed
- set_border_right_style() : mixed
- set_border_right_width() : mixed
- set_border_spacing() : mixed
- Sets the border spacing
- set_border_style() : mixed
- set_border_top() : mixed
- Sets the border styles
- set_border_top_color() : mixed
- set_border_top_left_radius() : mixed
- Sets the border radius size
- set_border_top_right_radius() : mixed
- set_border_top_style() : mixed
- set_border_top_width() : mixed
- set_border_width() : mixed
- set_color() : mixed
- Sets color
- set_font() : mixed
- Sets the font style
- set_font_size() : mixed
- Sets the font size
- set_font_weight() : mixed
- Sets the font weight
- set_frame() : mixed
- set_image_resolution() : mixed
- auto | normal | dpi
- set_letter_spacing() : mixed
- Sets letter spacing property
- set_line_height() : mixed
- Sets line height property
- set_list_style() : mixed
- Sets the list style
- set_list_style_image() : mixed
- Sets the list style image
- set_margin() : mixed
- set_margin_bottom() : mixed
- set_margin_left() : mixed
- set_margin_right() : mixed
- set_margin_top() : mixed
- Sets the margin size
- set_media_queries() : mixed
- set_origin() : mixed
- set_outline() : mixed
- Sets the outline styles
- set_outline_color() : mixed
- set_outline_style() : mixed
- set_outline_width() : mixed
- set_padding() : mixed
- set_padding_bottom() : mixed
- set_padding_left() : mixed
- set_padding_right() : mixed
- set_padding_top() : mixed
- Sets the padding size
- set_page_break_after() : mixed
- set_page_break_before() : mixed
- Sets page break properties
- set_prop() : mixed
- Sets the property value without calculating the computed value
- set_size() : mixed
- set_text_align() : mixed
- Sets the text alignment
- set_transform() : mixed
- set_transform_origin() : mixed
- Sets the CSS3 transform-origin property
- set_word_spacing() : mixed
- Sets word spacing property
- set_z_index() : mixed
- setFontMetrics() : $this
- _get_border() : mixed
- Return a single border property
- _get_border_radius_corner() : float|int|string
- _image() : string
- _set_border() : mixed
- Sets a single border
- _set_border_radii() : mixed
- _set_border_radius_corner() : mixed
- _set_style() : mixed
- _set_style_side_type() : mixed
- Generalized set function for individual attribute of combined style.
- _set_style_side_width_important() : mixed
- Anyway only called if _important matches and is assigned E.g. _set_style_side_type($style,$side,'',str_replace("none", "0px", $val),isset($this->_important_props[$style.'_'.$side]));
- _set_style_sides_type() : mixed
- _set_style_type() : mixed
- _set_style_type_important() : mixed
- parse_image_resolution() : null
- set_prop_color() : mixed
- _get_width() : mixed
Constants
CSS_IDENTIFIER
public
mixed
CSS_IDENTIFIER
= "-?[_a-zA-Z]+[_a-zA-Z0-9-]*"
CSS_INTEGER
public
mixed
CSS_INTEGER
= "-?\d+"
Properties
$_has_border_radius
public
bool
$_has_border_radius
= false
$BLOCK_TYPES
List of all block types. Should really be a constant.
public
static array<string|int, mixed>
$BLOCK_TYPES
= ["block", "inline-block", "table-cell", "list-item"]
$BORDER_STYLES
List of valid border styles. Should also really be a constant.
public
static array<string|int, mixed>
$BORDER_STYLES
= ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
$default_font_size
Default font size, in points.
public
static float
$default_font_size
= 12
$default_line_height
Default line height, as a fraction of the font size.
public
static float
$default_line_height
= 1.2
$font_size_keywords
Default "absolute" font sizes relative to the default font-size http://www.w3.org/TR/css3-fonts/#font-size-the-font-size-property
public
static array<string|int, float>
$font_size_keywords
= [
"xx-small" => 0.6,
// 3/5
"x-small" => 0.75,
// 3/4
"small" => 0.889,
// 8/9
"medium" => 1,
// 1
"large" => 1.2,
// 6/5
"x-large" => 1.5,
// 3/2
"xx-large" => 2.0,
]
$INLINE_TYPES
List of all inline types. Should really be a constant.
public
static array<string|int, mixed>
$INLINE_TYPES
= ["inline"]
$POSITIONNED_TYPES
List of all positionned types. Should really be a constant.
public
static array<string|int, mixed>
$POSITIONNED_TYPES
= ["relative", "absolute", "fixed"]
$TABLE_TYPES
List of all table types. Should really be a constant.
public
static mixed
$TABLE_TYPES
= ["table", "inline-table"]
array;
$text_align_keywords
List of valid text-align keywords. Should also really be a constant.
public
static array<string|int, mixed>
$text_align_keywords
= ["left", "right", "center", "justify"]
$vertical_align_keywords
List of valid vertical-align keywords. Should also really be a constant.
public
static array<string|int, mixed>
$vertical_align_keywords
= ["baseline", "bottom", "middle", "sub", "super", "text-bottom", "text-top", "top"]
$_defaults
Default style values.
protected
static array<string|int, mixed>
$_defaults
= null
Tags
$_dependency_map
protected
static mixed
$_dependency_map
= ["border_top_style" => ["border_top_width"], "border_bottom_style" => ["border_bottom_width"], "border_left_style" => ["border_left_width"], "border_right_style" => ["border_right_width"], "direction" => ["text_align"], "font_size" => ["background_position", "background_size", "border_top_width", "border_right_width", "border_bottom_width", "border_left_width", "line_height", "margin_top", "margin_right", "margin_bottom", "margin_left", "outline_width", "padding_top", "padding_right", "padding_bottom", "padding_left"]]
$_frame
protected
Frame
$_frame
$_important_props
protected
mixed
$_important_props
= []
$_inherited
List of inherited properties
protected
static array<string|int, mixed>
$_inherited
= null
Tags
$_media_queries
Media queries attached to the style
protected
int
$_media_queries
$_methods_cache
Caches method_exists result
protected
static array<string|int, bool>
$_methods_cache
= []
$_origin
The origin of the style
protected
int
$_origin
= DompdfCssStylesheet::ORIG_AUTHOR
$_parent_font_size
Font size of parent element in document tree. Used for relative font size resolution.
protected
float
$_parent_font_size
$_prop_cache
The used values of the CSS property
protected
array<string|int, mixed>
$_prop_cache
= []
$_props
Main array of all CSS properties & values
protected
array<string|int, mixed>
$_props
= []
$_props_computed
The computed values of the CSS property
protected
array<string|int, mixed>
$_props_computed
= []
$_props_shorthand
List of CSS shorthand properties
protected
static array<string|int, mixed>
$_props_shorthand
= ["background", "border", "border_bottom", "border_color", "border_left", "border_radius", "border_right", "border_style", "border_top", "border_width", "flex", "font", "list_style", "margin", "padding"]
$_stylesheet
The stylesheet this style belongs to
protected
Stylesheet
$_stylesheet
Tags
$_computed_border_radius
The computed border radius
private
mixed
$_computed_border_radius
= null
$_computed_bottom_spacing
The computed bottom spacing
private
mixed
$_computed_bottom_spacing
= null
$fontMetrics
private
FontMetrics
$fontMetrics
Methods
__construct()
Class constructor
public
__construct(Stylesheet $stylesheet[, int $origin = Stylesheet::ORIG_AUTHOR ]) : mixed
Parameters
- $stylesheet : Stylesheet
-
the stylesheet this Style is associated with.
- $origin : int = Stylesheet::ORIG_AUTHOR
Return values
mixed —__get()
PHP5 overloaded getter Along with {@link Style::__set()} __get() provides access to all CSS properties directly. Typically __get() is not called directly outside of this class.
public
__get(string $prop) : mixed
On each modification clear cache to return accurate setting. Also affects direct settings not using __set
Parameters
- $prop : string
Tags
Return values
mixed —__set()
PHP5 overloaded setter
public
__set(string $prop, mixed $val) : mixed
This function along with permit a user of the
Style class to access any (CSS) property using the following syntax:
Style->margin_top = "1em";
echo (Style->margin_top);
__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.
On each modification clear cache to return accurate setting. Also affects direct settings not using __set For easier finding all assignments, attempted to allowing only explicite assignment: Very many uses, e.g. AbstractFrameReflower.php -> for now leave as it is function __set($prop, $val) { throw new Exception("Implicit replacement of assignment by __set. Not good."); } function props_set($prop, $val) { ... }
Parameters
- $prop : string
-
the property to set
- $val : mixed
-
the value of the property
Return values
mixed —__toString()
Generate a string representation of the Style
public
__toString() : string
This dumps the entire property array into a string via print_r. Useful for debugging.
Return values
string —compute_props()
Calculates the computed value of the CSS properties that have been set (the specified properties)
public
compute_props() : mixed
Return values
mixed —computed_bottom_spacing()
public
computed_bottom_spacing() : float|null|string
Return values
float|null|string —debug_print()
public
debug_print() : mixed
Return values
mixed —dispose()
"Destructor": forcibly free all references held by this object
public
dispose() : mixed
Return values
mixed —get_background_color()
Returns the background color as an array
public
get_background_color() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —get_background_image()
Returns the background image URI, or "none"
public
get_background_image() : string
Tags
Return values
string —get_background_position()
Returns the background position as an array
public
get_background_position() : array<string|int, mixed>
The returned array has the following format:
array(x,y, "x" => x, "y" => y)
Tags
Return values
array<string|int, mixed> —get_background_size()
Returns the background size as an array
public
get_background_size() : string|array<string|int, mixed>
The return value has one of the following formats:
"cover"
"contain"
array(width,height)
Tags
Return values
string|array<string|int, mixed> —get_border_bottom()
public
get_border_bottom() : mixed
Return values
mixed —get_border_bottom_color()
public
get_border_bottom_color() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_border_bottom_left_radius()
public
get_border_bottom_left_radius() : float|int|string
Return values
float|int|string —get_border_bottom_right_radius()
public
get_border_bottom_right_radius() : float|int|string
Return values
float|int|string —get_border_left()
public
get_border_left() : mixed
Return values
mixed —get_border_left_color()
public
get_border_left_color() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_border_properties()
Return an array of all border properties.
public
get_border_properties() : array<string|int, mixed>
The returned array has the following structure:
array("top" => array("width" => [border-width],
"style" => [border-style],
"color" => [border-color (array)]),
"bottom" ... )
Return values
array<string|int, mixed> —get_border_right()
public
get_border_right() : mixed
Return values
mixed —get_border_right_color()
public
get_border_right_color() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_border_spacing()
Returns border spacing as an array
public
get_border_spacing() : array<string|int, mixed>
The array has the format (h_space,v_space)
Tags
Return values
array<string|int, mixed> —get_border_top()
public
get_border_top() : mixed
Return values
mixed —get_border_top_color()
public
get_border_top_color() : mixed
Return values
mixed —get_border_top_left_radius()
public
get_border_top_left_radius() : float|int|string
Return values
float|int|string —get_border_top_right_radius()
public
get_border_top_right_radius() : float|int|string
Return values
float|int|string —get_color()
Returns the color as an array
public
get_color() : array<string|int, mixed>
The array has the following format:
array(r,g,b, "r" => r, "g" => g, "b" => b, "hex" => "#rrggbb")
Tags
Return values
array<string|int, mixed> —get_computed_border_radius()
public
get_computed_border_radius( $w, $h) : array<string|int, mixed>|null
Parameters
Return values
array<string|int, mixed>|null —get_counter_increment()
public
get_counter_increment() : mixed
Return values
mixed —get_font_family()
Getter for the 'font-family' CSS property.
public
get_font_family() : string
Uses the class to resolve the font family into an actual font file.
Tags
Return values
string —get_font_family_raw()
public
get_font_family_raw() : string
Return values
string —get_frame()
public
get_frame() : Frame
Return values
Frame —get_letter_spacing()
public
get_letter_spacing() : float
Tags
Return values
float —get_line_height()
public
get_line_height() : float
Tags
Return values
float —get_list_style_image()
Returns the list style image URI, or "none"
public
get_list_style_image() : string
Tags
Return values
string —get_margin_bottom()
public
get_margin_bottom() : mixed
Return values
mixed —get_margin_left()
public
get_margin_left() : mixed
Return values
mixed —get_margin_right()
public
get_margin_right() : mixed
Return values
mixed —get_margin_top()
public
get_margin_top() : mixed
Return values
mixed —get_media_queries()
public
get_media_queries() : array<string|int, mixed>|int
Return values
array<string|int, mixed>|int —get_origin()
public
get_origin() : int
Return values
int —get_outline()
public
get_outline() : mixed
Return values
mixed —get_outline_color()
Returns the outline color as an array
public
get_outline_color() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —get_outline_width()
public
get_outline_width() : mixed
Return values
mixed —get_padding_bottom()
public
get_padding_bottom() : mixed
Return values
mixed —get_padding_left()
public
get_padding_left() : mixed
Return values
mixed —get_padding_right()
public
get_padding_right() : mixed
Return values
mixed —get_padding_top()
public
get_padding_top() : mixed
Return values
mixed —get_prop()
Similar to __get() without storing the result. Useful for accessing properties while loading stylesheets.
public
get_prop( $prop) : string
Parameters
Tags
Return values
string —get_stylesheet()
returns the {@link Stylesheet} this Style is associated with.
public
get_stylesheet() : Stylesheet
Return values
Stylesheet —get_transform()
Gets the CSS3 transform property
public
get_transform() : array<string|int, mixed>|null
Tags
Return values
array<string|int, mixed>|null —get_transform_origin()
Gets the CSS3 transform-origin property
public
get_transform_origin() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —get_word_spacing()
public
get_word_spacing() : float
Tags
Return values
float —getFontMetrics()
public
getFontMetrics() : FontMetrics
Return values
FontMetrics —important_get()
public
important_get( $prop) : bool
Parameters
Return values
bool —important_set()
public
important_set(mixed $prop) : mixed
Parameters
- $prop : mixed
Return values
mixed —inherit()
Set inherited properties in this style using values in $parent
public
inherit(Style $parent) : Style
Parameters
- $parent : Style
Return values
Style —length_in_pt()
Converts any CSS length value into an absolute length in points.
public
length_in_pt(float|string|array<string|int, mixed> $length[, float $ref_size = null ]) : float|string
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 any of the lengths provided are "auto" or "none" then that value is returned.
If a reference size is not provided, the default font size is used ().
Parameters
- $length : float|string|array<string|int, mixed>
-
the numeric length (or string measurement) or array of lengths to resolve
- $ref_size : float = null
-
an absolute reference size to resolve percentage lengths
Return values
float|string —merge()
Override properties in this style with those in $style
public
merge(Style $style) : mixed
Parameters
- $style : Style
Return values
mixed —munge_color()
Returns an array(r, g, b, "r"=> r, "g"=>g, "b"=>b, "hex"=>"#rrggbb") based on the provided CSS color value.
public
munge_color(string $color) : array<string|int, mixed>
Parameters
- $color : string
Return values
array<string|int, mixed> —set__dompdf_background_image_resolution()
public
set__dompdf_background_image_resolution( $val) : mixed
Parameters
Return values
mixed —set__dompdf_image_resolution()
public
set__dompdf_image_resolution( $val) : mixed
Parameters
Return values
mixed —set__webkit_transform()
public
set__webkit_transform( $val) : mixed
Parameters
Return values
mixed —set__webkit_transform_origin()
public
set__webkit_transform_origin( $val) : mixed
Parameters
Return values
mixed —set_background()
Sets the background - combined options
public
set_background(string $val) : mixed
Parameters
- $val : string
Tags
Return values
mixed —set_background_attachment()
Sets the background attachment
public
set_background_attachment(string $val) : mixed
Parameters
- $val : string
Tags
Return values
mixed —set_background_color()
Sets the background color
public
set_background_color(string $color) : mixed
Parameters
- $color : string
Tags
Return values
mixed —set_background_image()
Set the background image url
public
set_background_image(string $val) : mixed
Parameters
- $val : string
Tags
Return values
mixed —set_background_image_resolution()
auto | normal | dpi
public
set_background_image_resolution( $val) : mixed
Parameters
Return values
mixed —set_background_position()
Sets the background position
public
set_background_position(string $val) : mixed
Parameters
- $val : string
Tags
Return values
mixed —set_background_repeat()
Sets the background repeat
public
set_background_repeat(string $val) : mixed
Parameters
- $val : string
Tags
Return values
mixed —set_background_size()
Sets the background size
public
set_background_size(string $val) : mixed
Parameters
- $val : string
Tags
Return values
mixed —set_border()
public
set_border( $val) : mixed
Parameters
Return values
mixed —set_border_bottom()
public
set_border_bottom( $val) : mixed
Parameters
Return values
mixed —set_border_bottom_color()
public
set_border_bottom_color(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —set_border_bottom_left_radius()
public
set_border_bottom_left_radius( $val) : mixed
Parameters
Return values
mixed —set_border_bottom_right_radius()
public
set_border_bottom_right_radius( $val) : mixed
Parameters
Return values
mixed —set_border_bottom_style()
public
set_border_bottom_style(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —set_border_bottom_width()
public
set_border_bottom_width(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —set_border_color()
public
set_border_color( $val) : mixed
Parameters
Return values
mixed —set_border_left()
public
set_border_left( $val) : mixed
Parameters
Return values
mixed —set_border_left_color()
public
set_border_left_color(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —set_border_left_style()
public
set_border_left_style(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —set_border_left_width()
public
set_border_left_width(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —set_border_radius()
public
set_border_radius( $val) : mixed
Parameters
Return values
mixed —set_border_right()
public
set_border_right( $val) : mixed
Parameters
Return values
mixed —set_border_right_color()
public
set_border_right_color(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —set_border_right_style()
public
set_border_right_style(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —set_border_right_width()
public
set_border_right_width(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —set_border_spacing()
Sets the border spacing
public
set_border_spacing(float $val) : mixed
Parameters
- $val : float
Tags
Return values
mixed —set_border_style()
public
set_border_style( $val) : mixed
Parameters
Return values
mixed —set_border_top()
Sets the border styles
public
set_border_top(string $val) : mixed
Parameters
- $val : string
Tags
Return values
mixed —set_border_top_color()
public
set_border_top_color(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —set_border_top_left_radius()
Sets the border radius size
public
set_border_top_left_radius( $val) : mixed
http://www.w3.org/TR/css3-background/#corners
Parameters
Return values
mixed —set_border_top_right_radius()
public
set_border_top_right_radius( $val) : mixed
Parameters
Return values
mixed —set_border_top_style()
public
set_border_top_style(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —set_border_top_width()
public
set_border_top_width(mixed $val) : mixed
Parameters
- $val : mixed
Return values
mixed —set_border_width()
public
set_border_width( $val) : mixed
Parameters
Return values
mixed —set_color()
Sets color
public
set_color(string $color) : mixed
The color parameter can be any valid CSS color value
Parameters
- $color : string
Tags
Return values
mixed —set_font()
Sets the font style
public
set_font( $val) : mixed
combined attributes set individual attributes also, respecting !important mark exactly this order, separate by space. Multiple fonts separated by comma: font-style, font-variant, font-weight, font-size, line-height, font-family
Other than with border and list, existing partial attributes should reset when starting here, even when not mentioned. If individual attribute is !important and explicit or implicit replacement is not, keep individual attribute
require whitespace as delimiters for single value attributes On delimiter "/" treat first as font height, second as line height treat all remaining at the end of line as font font-style, font-variant, font-weight, font-size, line-height, font-family
missing font-size and font-family might be not allowed, but accept it here and use default (medium size, empty font name)
Parameters
Tags
Return values
mixed —set_font_size()
Sets the font size
public
set_font_size(string|float $size) : mixed
$size can be any acceptable CSS size
Parameters
- $size : string|float
Tags
Return values
mixed —set_font_weight()
Sets the font weight
public
set_font_weight(string|int $weight) : mixed
Parameters
- $weight : string|int
Return values
mixed —set_frame()
public
set_frame(Frame $frame) : mixed
Parameters
- $frame : Frame
Return values
mixed —set_image_resolution()
auto | normal | dpi
public
set_image_resolution( $val) : mixed
Parameters
Return values
mixed —set_letter_spacing()
Sets letter spacing property
public
set_letter_spacing( $val) : mixed
Parameters
Tags
Return values
mixed —set_line_height()
Sets line height property
public
set_line_height( $val) : mixed
Parameters
Tags
Return values
mixed —set_list_style()
Sets the list style
public
set_list_style( $val) : mixed
Parameters
Tags
Return values
mixed —set_list_style_image()
Sets the list style image
public
set_list_style_image( $val) : mixed
Parameters
Tags
Return values
mixed —set_margin()
public
set_margin( $val) : mixed
Parameters
Return values
mixed —set_margin_bottom()
public
set_margin_bottom( $val) : mixed
Parameters
Return values
mixed —set_margin_left()
public
set_margin_left( $val) : mixed
Parameters
Return values
mixed —set_margin_right()
public
set_margin_right( $val) : mixed
Parameters
Return values
mixed —set_margin_top()
Sets the margin size
public
set_margin_top( $val) : mixed
Parameters
Tags
Return values
mixed —set_media_queries()
public
set_media_queries( $media_queries) : mixed
Parameters
Return values
mixed —set_origin()
public
set_origin( $origin) : mixed
Parameters
Return values
mixed —set_outline()
Sets the outline styles
public
set_outline(string $val) : mixed
Parameters
- $val : string
Tags
Return values
mixed —set_outline_color()
public
set_outline_color( $val) : mixed
Parameters
Return values
mixed —set_outline_style()
public
set_outline_style( $val) : mixed
Parameters
Return values
mixed —set_outline_width()
public
set_outline_width( $val) : mixed
Parameters
Return values
mixed —set_padding()
public
set_padding( $val) : mixed
Parameters
Return values
mixed —set_padding_bottom()
public
set_padding_bottom( $val) : mixed
Parameters
Return values
mixed —set_padding_left()
public
set_padding_left( $val) : mixed
Parameters
Return values
mixed —set_padding_right()
public
set_padding_right( $val) : mixed
Parameters
Return values
mixed —set_padding_top()
Sets the padding size
public
set_padding_top( $val) : mixed
Parameters
Tags
Return values
mixed —set_page_break_after()
public
set_page_break_after( $break) : mixed
Parameters
Return values
mixed —set_page_break_before()
Sets page break properties
public
set_page_break_before(string $break) : mixed
Parameters
- $break : string
Tags
Return values
mixed —set_prop()
Sets the property value without calculating the computed value
public
set_prop( $prop, $val) : mixed
Parameters
Return values
mixed —set_size()
public
set_size( $val) : mixed
Parameters
Return values
mixed —set_text_align()
Sets the text alignment
public
set_text_align(mixed $val) : mixed
If no alignment is set on the element and the direction is rtl then the property is set to "right", otherwise it is set to "left".
Parameters
- $val : mixed
Tags
Return values
mixed —set_transform()
public
set_transform( $val) : mixed
Parameters
Return values
mixed —set_transform_origin()
Sets the CSS3 transform-origin property
public
set_transform_origin(string $val) : mixed
Parameters
- $val : string
Tags
Return values
mixed —set_word_spacing()
Sets word spacing property
public
set_word_spacing( $val) : mixed
Parameters
Tags
Return values
mixed —set_z_index()
public
set_z_index( $val) : mixed
Parameters
Return values
mixed —setFontMetrics()
public
setFontMetrics(FontMetrics $fontMetrics) : $this
Parameters
- $fontMetrics : FontMetrics
Return values
$this —_get_border()
Return a single border property
protected
_get_border(string $side) : mixed
Parameters
- $side : string
Return values
mixed —_get_border_radius_corner()
protected
_get_border_radius_corner( $corner) : float|int|string
Parameters
Return values
float|int|string —_image()
protected
_image( $val) : string
Parameters
Return values
string —_set_border()
Sets a single border
protected
_set_border(string $side, string $border_spec, bool $important) : mixed
Parameters
- $side : string
- $border_spec : string
-
([width] [style] [color])
- $important : bool
Return values
mixed —_set_border_radii()
protected
_set_border_radii( $val1, $val2, $val3, $val4) : mixed
Parameters
Return values
mixed —_set_border_radius_corner()
protected
_set_border_radius_corner( $val, $corner) : mixed
Parameters
Return values
mixed —_set_style()
protected
_set_style( $style, $val, $important) : mixed
Parameters
Return values
mixed —_set_style_side_type()
Generalized set function for individual attribute of combined style.
protected
_set_style_side_type( $style, $side, $type, $val, $important) : mixed
With check for !important Applicable for background, border, padding, margin, font, list_style
Note: $type has a leading underscore (or is empty), the others not.
Parameters
Return values
mixed —_set_style_side_width_important()
Anyway only called if _important matches and is assigned E.g. _set_style_side_type($style,$side,'',str_replace("none", "0px", $val),isset($this->_important_props[$style.'_'.$side]));
protected
_set_style_side_width_important( $style, $side, $val) : mixed
Parameters
Return values
mixed —_set_style_sides_type()
protected
_set_style_sides_type( $style, $top, $right, $bottom, $left, $type, $important) : mixed
Parameters
Return values
mixed —_set_style_type()
protected
_set_style_type( $style, $type, $val, $important) : mixed
Parameters
Return values
mixed —_set_style_type_important()
protected
_set_style_type_important( $style, $type, $val) : mixed
Parameters
Return values
mixed —parse_image_resolution()
protected
parse_image_resolution( $val) : null
Parameters
Return values
null —set_prop_color()
protected
set_prop_color(mixed $prop, mixed $color) : mixed
Parameters
- $prop : mixed
- $color : mixed
Return values
mixed —_get_width()
private
_get_width(mixed $prop) : mixed
Parameters
- $prop : mixed