Skip to main content

Module css

Module css 

Source
Expand description

CSS-like styling system for the browser-mode renderer.

Inspired by Remotion (React inline styles) and CSS box model. Provides:

  • CssStyle: a struct mirroring the CSS properties supported by the engine
  • units: parsing/resolution of CSS lengths (px, %, em, rem, vw, vh, fr, auto)
  • cascade: parent → child inheritance pass
  • taffy_bridge: conversion CssStyletaffy::Style for layout

Layout is computed by taffy; paint is done by Skia in engine::paint_pass.

Re-exports§

pub use animation::apply_animated_props;
pub use style::CssStyle;
pub use units::Length;
pub use units::LengthContext;
pub use units::LengthPercentage;

Modules§

animation
Bridge from the legacy AnimatedProperties (Flutter-style) to CSS-style overrides on CssStyle. Used by the new pipeline so animations resolved through animator::resolve_props_for_effects flow into transform, opacity, filter, etc. before layout/paint.
cascade
CSS cascade & inheritance.
style
CssStyle — typed mirror of the CSS properties supported by the engine.
taffy_bridge
CssStyletaffy::Style converter.
units
CSS length/percentage units.