module UI::DesignTokens::Defaults

Overview

Default palette and scale values. Kept in a private namespace so the Tokens.default factory is the one publicly-documented entry point.

Numeric values match Components::CSS::Tokens::Theme.amber_default and Components::CSS::Config exactly — amber_theme.cr is the source of truth for OKLCH values; css_config.cr is the source of truth for spacing/radius/typography/breakpoints.

Extended Modules

Defined in:

ui/design_tokens.cr

Instance Method Summary

Instance Method Detail

def breakpoints : Breakpoints #

[View source]
def dark_palette : ColorPalette #

[View source]
def light_palette : ColorPalette #

[View source]
def material : Material #

Phase 5 — glass material defaults.

Per-step values calibrated to preserve every renderer's existing visual behavior at intensity == 1.0. Brands override these via Brand#override_material(material) returning a new Material (use the auto-generated record copy_with to mutate just the fields the brand cares about).


[View source]
def motion_scale : MotionScale #

[View source]
def radius_scale : RadiusScale #

Library-generic radius scale. Names: none / sm / md / lg / xl / x2l / pill. Numeric values track css_config.cr default_border_radius.


[View source]
def shadow_scale : ShadowScale #

[View source]
def spacing : SpacingScale #

Tailwind/css_config-derived spacing scale in rem.


[View source]
def type_scale : TypeScale #

The body/title/headline sizes are stored in rem (1rem == 16 logical points). The Apple generator multiplies by 16 and overrides with HIG-canonical sizes (17 pt body) only when the brand has not customized the size — see AppleGenerator for the policy.


[View source]