Expand description
Styling system — powered by Mozilla’s Stylo CSS engine.
This is the ONLY module that imports Stylo types. All other code (dom, layout, paint, public API) uses re-exports from here.
Modules§
- builder
- Type-safe style API — zero CSS parsing, direct
PropertyDeclaration. - style_
structs - Property struct groups — access computed values by category.
Usage:
computed_values.get_box().clone_display()The module where all the style structs are defined. - taffy_
bridge - Stylo ↔ Taffy bridge — converts
ComputedValuesto Taffy layout styles. - units
- CSS unit helpers —
px(100.0),pct(50.0),em(1.5), etc. - values
- Computed value types that exist as standalone re-exports.
Structs§
- Absolute
Color - Stylo color type — used by
bg(),border_color(), etc. An absolutely specified color, using either rgb(), rgba(), lab(), lch(), oklab(), oklch() or color(). - Arc
- Arc wrapper used by Stylo. An atomically reference counted shared pointer
- Computed
Values - Computed style values for an element. All CSS properties accessible via
property struct getters (e.g.
cv.get_box().clone_display()). The struct that Servo uses to represent computed values. - Property
Declaration Block - A parsed CSS declaration block (inline styles, stylesheet rules). Overridden declarations are skipped.
- Shared
RwLock - Stylo’s shared lock — needed to read locked declarations. A shared read/write lock that can protect multiple objects.
- Shared
RwLock Read Guard - Stylo’s shared lock — needed to read locked declarations. Proof that a shared lock was obtained for reading (servo).
Enums§
- Border
Style - CSS border-style keyword —
Solid,Dashed,Dotted,None, etc. A specified value for a single side of aborder-styleproperty.
Functions§
- initial_
values_ arc - Returns initial (default) computed values wrapped in Arc.
Stylo equivalent of the old
ComputedStyle::default(). Uses a static cache to avoid repeated allocation.