Skip to main content

euv_core/style/sheet/
struct.rs

1use super::*;
2
3/// Complete compiled style value combining layout, paint, and typography with zero heap allocations.
4#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
5pub struct Style {
6    /// Layout geometry properties.
7    #[get(type(copy))]
8    pub(crate) layout: LayoutStyle,
9    /// Visual paint properties.
10    #[get(type(copy))]
11    pub(crate) paint: PaintStyle,
12    /// Typography properties.
13    #[get(type(copy))]
14    pub(crate) text: TextStyle,
15}
16
17/// Responsive style bundle resolving deterministically for compact, medium, and expanded viewports.
18#[derive(Clone, Copy, Data, Debug, Default, New, PartialEq)]
19pub struct ResponsiveStyle {
20    /// Base style applied across all breakpoints.
21    #[get(type(copy))]
22    pub(crate) base: Style,
23    /// Optional style override when viewport is `Breakpoint::Compact`.
24    #[new(skip)]
25    #[get(skip)]
26    pub(crate) compact: Option<Style>,
27    /// Optional style override when viewport is `Breakpoint::Medium`.
28    #[new(skip)]
29    #[get(skip)]
30    pub(crate) medium: Option<Style>,
31}