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
- Compound
Selector - 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. - Computed
Style - ComputedStyle struct (moved from velox-style)
- Rule
- Selector
Part - 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§
- Align
Items - Align items
- Align
Self - Align self (for individual flex children)
- Border
Style - 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
>betweendivand.cardindiv > .card). - Display
- Display enum
- Flex
Direction - Flex direction
- Flex
Wrap - Flex wrap enum
- Font
Weight - Font weight enum
- Justify
Content - Justify content
- Length
- A CSS length value with unit
- Overflow
- Overflow
- Position
- Position enum
- Text
Align - Text align enum
- Text
Decoration - Text decoration enum
- Text
Overflow - Text-overflow handling
- Timing
Function - CSS transition timing function
- Transform
Op - Transform operations
- Vertical
Align - How an inline-level box is aligned within its line box.
- Visibility
- Visibility enum
- White
Space - White-space handling per CSS Text
Constants§
- PLACEHOLDER_
STYLE_ ATTR - Attribute the cascade writes
::placeholderdeclarations onto.
Functions§
- apply_
styles - Apply stylesheet to a VNode recursively, returning a new VNode
with inline
styleattributes 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.
ancestorsprovides the VNode ancestor chain for compound selector matching. - is_
viewport_ filling - Viewport-filling predicate for
ComputedStyle, expanded to handle100% | 100vw | 100dvw | 100vh | 100dvh | min-height.is_root_indexshould be true whensource_index == 0(first VNode always fills). - resolve_
auto_ margins - Resolve
margin: autofor 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).