Class Dompdf\Css\Style

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 properties.

Access to the different CSS properties is provided by the methods {@link Style::set_prop()} and {@link Style::get_specified()}, and the property overload methods {@link Style::__set()} and {@link Style::__get()}, as well as {@link Style::set_used()}. The latter methods operate on used values and permit access to any (CSS) property using the following syntax:

$style->margin_top = 10.0;
echo $style->margin_top; // Returns `10.0`

To declare a property from a string, use {@link Style::set_prop()}:

$style->set_prop("margin_top", "1em");
echo $style->get_specified("margin_top"); // Returns `1em`
echo $style->margin_top; // Returns `12.0`, assuming the default font size

Actual CSS parsing is performed in the {@link Stylesheet} class.

Methods
Constants
Properties