Skip to main content

Crate velox_style

Crate velox_style 

Source
Expand description

Velox Style - CSS Styling System

This crate provides comprehensive CSS support for Velox:

  • CSS property parsing and computed styles
  • Unit handling (px, %, rem, em, vw, vh)
  • Color parsing (hex, rgb, rgba, named colors)
  • Flexbox layout properties
  • Style inheritance and cascading

Re-exports§

pub use fonts::FontDescriptor;
pub use fonts::FontFamily;
pub use fonts::FontStyle;
pub use fonts::GenericFamily;
pub use fonts::LineHeight;
pub use visual_effects::BorderRadius;
pub use visual_effects::BoxShadow as VisualBoxShadow;
pub use visual_effects::TextShadow;

Modules§

fonts
Font management system for Velox
ua
visual_effects
Visual effects and decorations for CSS

Structs§

Border
Border struct
BoxShadow
Box shadow struct
Color
A CSS color value
CompoundSelector
A compound CSS selector — a chain of SelectorParts connected by combinators (whitespace for descendant, > for child). The rightmost part matches the target element; preceding parts must match ancestors according to the combinator stored on each part.
ComputedStyle
ComputedStyle struct (moved from velox-style)
Rule
SelectorPart
A single part of a CSS selector (e.g., h1, .class, h1.class, [attr]).
Sides
Sides type for margin, padding, etc.
Stylesheet
Transform
Transform struct
Transition
A single CSS transition (e.g. opacity 0.2s ease-in 0.1s)

Enums§

AlignItems
Align items
AlignSelf
Align self (for individual flex children)
BorderStyle
Border style enum
BoxSizing
Box sizing enum
Combinator
How a selector part is connected to the part on its left in the source selector (e.g. the > between div and .card in div > .card).
Display
Display enum
FlexDirection
Flex direction
FlexWrap
Flex wrap enum
FontWeight
Font weight enum
JustifyContent
Justify content
Length
A CSS length value with unit
Overflow
Overflow
Position
Position enum
TextAlign
Text align enum
TextDecoration
Text decoration enum
TextOverflow
Text-overflow handling
TimingFunction
CSS transition timing function
TransformOp
Transform operations
VerticalAlign
How an inline-level box is aligned within its line box.
Visibility
Visibility enum
WhiteSpace
White-space handling per CSS Text

Constants§

PLACEHOLDER_STYLE_ATTR
Attribute the cascade writes ::placeholder declarations onto.

Functions§

apply_styles
Apply stylesheet to a VNode recursively, returning a new VNode with inline style attributes populated.
apply_styles_with_hover
Apply stylesheet with a custom hover predicate
apply_with_cascade
Apply the 3-layer cascade UA < author < inline.
apply_with_cascade_with_hover
Cascade with a custom hover predicate.
compute_styles_for_node
Compute styles for a VNode given inline styles and optional stylesheet Returns a ComputedStyle with all properties resolved. ancestors provides the VNode ancestor chain for compound selector matching.
is_viewport_filling
Viewport-filling predicate for ComputedStyle, expanded to handle 100% | 100vw | 100dvw | 100vh | 100dvh | min-height. is_root_index should be true when source_index == 0 (first VNode always fills).
resolve_auto_margins
Resolve margin: auto for a block-level box (CSS 2.1 §10.3.3).
resolve_auto_margins_core
Core auto-margin distribution (CSS 2.1 §10.3.3).
root_is_viewport_filling
Root-is-viewport-filling helper: index == 0 ⇒ true (first VNode always fills).