Skip to main content

Crate iced_plus_tokens

Crate iced_plus_tokens 

Source
Expand description

Design tokens for iced-plus.

This crate provides a comprehensive set of design tokens for building consistent, themeable user interfaces with the iced GUI framework.

§Token Categories

  • Colors: Color scales and semantic palettes
  • Typography: Text styles with font, size, weight, and line height
  • Spacing: Modular spacing scale for margins, padding, and gaps
  • Radius: Border radius presets
  • Elevation: Shadow and depth definitions
  • Motion: Animation duration and easing presets

§Example

use iced_plus_tokens::presets;

// Get a pre-built theme
let theme = presets::light();

// Access tokens
let spacing = theme.tokens.spacing.lg(); // 16.0
let primary = theme.tokens.colors.primary.s500; // Primary blue

§Feature Flags

  • preset-light (default): Include the light theme preset
  • preset-dark (default): Include the dark theme preset
  • serde: Enable serialization/deserialization support

Re-exports§

pub use color::Color;
pub use color::ColorPalette;
pub use color::ColorScale;
pub use color::SemanticColors;
pub use color::Shade;
pub use elevation::Elevation;
pub use elevation::ElevationLevel;
pub use elevation::ElevationScale;
pub use elevation::Shadow;
pub use motion::DurationPreset;
pub use motion::Easing;
pub use motion::Motion;
pub use motion::MotionScale;
pub use radius::RadiusScale;
pub use radius::RadiusSize;
pub use spacing::SpacingScale;
pub use spacing::SpacingSize;
pub use tokens::ThemePreset;
pub use tokens::ThemeTokens;
pub use typography::FontWeight;
pub use typography::TextStyle;
pub use typography::TextStyleName;
pub use typography::TypographyScale;

Modules§

color
Color tokens for the design system.
elevation
Elevation and shadow tokens.
motion
Motion and animation timing tokens.
presets
Built-in theme presets.
radius
Border radius tokens.
spacing
Spacing scale tokens.
tokens
Aggregate theme tokens structure.
typography
Typography tokens for text styling.