Expand description
Style RESOLUTION for layout: a node’s style object (token references
already resolved by the theme, conditions still nested) → the flat map for
this pass (conditions::resolve_conditions: media against the SURFACE
box, the state keys against the node’s states) → logical properties made
physical from the surface direction → a taffy Style plus the painted
Visual.
Rules from the VAPP-4 spike that every painter relies on: border-box, flex
row default, min-width: auto, overflow: hidden = clip, the border
widths (borderWidth and the four sides) are the visual keys with layout
effect, absolute nodes paint last among their siblings (no z-index).
Round 1 adds the per-side and per-corner keys, gradients, paint-only
transforms, transitions (resolved durations + easings), text styling,
overflowX/Y, visibility, pointerEvents, userSelect, cursor.
Re-exports§
pub use crate::conditions::is_condition_key;pub use crate::conditions::resolve_conditions;pub use crate::conditions::ConditionContext;
Structs§
- Gradient
- A linear gradient painted OVER
background_color(CSS angle: 0 = up, 90 = right). - Gradient
Stop - One gradient stop: a resolved colour at 0..1.
- Shadow
Layer - One shadow layer, resolved.
- Transition
- The motion a node’s colour/opacity/transform/size changes animate with:
the resolved
$motion.*duration (0 under reduced motion) and the$ease.*cubic bezier (CSSeasewhen unset). - Visual
- Painted properties, RESOLVED (hex colours, px numbers, shadow layers, family names). Painters never read the theme; they paint this.
- Visual
Animation - A node’s animation (
animation+animationDuration, resolved).
Enums§
- BoxKind
- How a node’s padding and border reach taffy.
- Transform
Op - One paint-only transform function, in source order (applied around the
box’s centre, like CSS
transform-origin: center).
Constants§
- DEFAULT_
EASING - CSS
ease, the easing of atransitionwithouttransitionEasing.
Functions§
- axis_
overflow - The overflow of one axis: the axis key over
overflow. - border_
sides - The border widths
[top, right, bottom, left](borderWidththen the sides);Nonewhen no width key is set. - direction_
of - A resolved style’s own
direction(inherited down the tree by the surface; the root’s, else the locale’s, is the surface direction). - is_
scroll_ container - Is the flat style a scroll container on either axis?
- parse_
transform translate(Xpx, Ypx) scale(N) rotate(Ndeg)→ the ops in order.- percent_
value - A
"N%"length as a fraction (0.5 for50%). - px
- A length in px when it is a plain number or
Npx(not%/auto). - resolve_
logical - Logical properties → physical sides for the surface direction. taffy has
only physical rects. A logical key wins over the physical one it maps to
(it states the direction-aware intent).
insetBlockStart/Endaretop/bottom;textAlign: start|endbecomesleft|right. - sides_
px - The px sides
[top, right, bottom, left]of a padding-like key family (padding,paddingHorizontal,paddingVertical, the four sides; the logical keys are already physical here).Nonewhen no key is set. - to_
taffy - Resolved flat map → taffy style.
directionis NOT inherited by taffy, so the caller passes the surface’s and every node gets it. - visual
- The painted subset of a resolved flat map. For a
BoxKind::Leafthe recipe’s padding/gap ride along for the painter and the measurer.%radii are left out here (the surface resolves them against the box).