Skip to main content

Module style

Module style 

Source
Expand description

style!: the application’s style overrides and motion tokens.

style! {
    motion {
        jelly: spring(period: 0.42, damping: 0.42),
    }
    SidebarItem {
        corner: 8,
        hover: scale(1.03, snappy),
        selected: fill(accent),
    }
    Button.hero { size: large }
    #[target(macos)]
    SidebarItem { selected: system }
}

This module only reads the declaration; what each property means and where it applies is checked by the build tool.

Structs§

CornerBlock
A corner { name: radius } block, for every platform or, with #[target(…)], for those named.
MotionDecl
name: spring(period: T, damping: ζ).
StyleArg
StyleItem
StyleProp
StyleRuleItem
Component or Component.variant, with its properties.

Enums§

StyleValue
A property value: a number, a name such as accent or fill.subtle, text, a call such as scale(1.03, snappy), or effects joined by +.

Functions§

parse_style
Parse the body of a style! invocation.