euv-core 0.51.0

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
use super::*;

/// Complete compiled style value combining layout, paint, and typography with zero heap allocations.
#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
pub struct Style {
    /// Layout geometry properties.
    #[get(type(copy))]
    pub(crate) layout: LayoutStyle,
    /// Visual paint properties.
    #[get(type(copy))]
    pub(crate) paint: PaintStyle,
    /// Typography properties.
    #[get(type(copy))]
    pub(crate) text: TextStyle,
}

/// Responsive style bundle resolving deterministically for compact, medium, and expanded viewports.
#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
pub struct ResponsiveStyle {
    /// Base style applied across all breakpoints.
    #[get(type(copy))]
    pub(crate) base: Style,
    /// Optional style override when viewport is `Breakpoint::Compact`.
    #[new(skip)]
    #[get(skip)]
    pub(crate) compact: Option<Style>,
    /// Optional style override when viewport is `Breakpoint::Medium`.
    #[new(skip)]
    #[get(skip)]
    pub(crate) medium: Option<Style>,
}

/// Keyless `style!` property wrapper setting layout box width.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Width(pub Length);

/// Keyless `style!` property wrapper setting layout box height.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Height(pub Length);

/// Keyless `style!` property wrapper setting minimum layout width constraint.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct MinWidth(pub Length);

/// Keyless `style!` property wrapper setting minimum layout height constraint.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct MinHeight(pub Length);

/// Keyless `style!` property wrapper setting maximum layout width constraint.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct MaxWidth(pub Length);

/// Keyless `style!` property wrapper setting maximum layout height constraint.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct MaxHeight(pub Length);

/// Keyless `style!` property wrapper setting initial flex main-axis basis length.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct FlexBasis(pub Length);

/// Keyless `style!` property wrapper setting explicit `width / height` aspect ratio.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct AspectRatio(pub f32);

/// Keyless `style!` property wrapper setting inner box padding edges.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Padding(pub Edges);

/// Keyless `style!` property wrapper setting outer box margin edges.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Margin(pub Edges);

/// Keyless `style!` property wrapper setting uniform row and column gap in logical pixels.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Gap(pub f32);

/// Keyless `style!` property wrapper setting vertical row gap in logical pixels.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct RowGap(pub f32);

/// Keyless `style!` property wrapper setting horizontal column gap in logical pixels.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct ColumnGap(pub f32);

/// Keyless `style!` property wrapper setting flex grow factor.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct FlexGrow(pub f32);

/// Keyless `style!` property wrapper setting flex shrink factor.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct FlexShrink(pub f32);

/// Keyless `style!` property wrapper setting stacking order `z_index`.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct ZIndex(pub i32);

/// Keyless `style!` property wrapper configuring `Display::Grid` with equal-width column count.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct GridColumns(pub u16);

/// Keyless `style!` property wrapper setting `(top, right, bottom, left)` positioned offsets.
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Inset(
    pub Option<f32>,
    pub Option<f32>,
    pub Option<f32>,
    pub Option<f32>,
);

/// Keyless `style!` property wrapper setting solid background fill color.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct Background(pub Color);

/// Keyless `style!` property wrapper setting uniform corner radius in logical pixels.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Radius(pub f32);

/// Keyless `style!` property wrapper setting focus-ring stroke border.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct FocusRing(pub Border);

/// Keyless `style!` property wrapper setting visual opacity in `[0.0, 1.0]`.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Opacity(pub f32);

/// Keyless `style!` property wrapper controlling scroll-delta propagation blocking.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct StopScrollPropagation(pub bool);

/// Keyless `style!` property wrapper controlling pointer/click event bubbling blocking.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct StopEventPropagation(pub bool);

/// Keyless `style!` property wrapper setting foreground text color.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct TextColor(pub Color);

/// Keyless `style!` property wrapper setting font size in logical pixels.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct FontSize(pub f32);

/// Keyless `style!` property wrapper setting line-height multiplier.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct LineHeight(pub f32);

/// Keyless `style!` property wrapper setting inter-glyph letter spacing in logical pixels.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct LetterSpacing(pub f32);

/// Keyless `style!` property wrapper enabling or disabling italic text slant.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct Italic(pub bool);

/// Keyless `style!` property wrapper enabling or disabling text underline decoration.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct Underline(pub bool);

/// Keyless `style!` property wrapper enabling or disabling text strikethrough decoration.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct Strikethrough(pub bool);

/// Keyless `style!` property wrapper enabling or disabling interactive text selection.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct Selectable(pub bool);

/// Keyless `style!` property wrapper setting text selection highlight tint color.
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct SelectionColor(pub Color);