Skip to main content

Module theme

Module theme 

Source
Expand description

Design tokens and the built-in light and dark themes.

Every component resolves its colours through Tokens::of, so any iced::Theme works. light and dark are tuned for the library, and Config builds a theme with your own colours on top of either.

Modules§

radius
Corner radii in logical pixels.
space
Spacing scale in logical pixels.
text_size
Text sizes in logical pixels.

Structs§

Config
Builds a Theme from your own colours, starting from the light or dark defaults. Text on coloured surfaces, such as a primary button’s label, is picked automatically with on.
Tokens
Semantic colours resolved from a theme.

Functions§

dark
The library’s dark theme.
fade
Returns color with its alpha multiplied by alpha.
font
The registered base font, or iced’s default when none is set.
light
The library’s light theme.
mix
Linearly blends a towards b by t (0.0 is a, 1.0 is b).
on
Near-black or near-white, whichever reads better on background.
semibold
The base font at semibold weight.
set_font
Registers the font components use for emphasised text, such as card and toast titles. Pass the same font you give iced’s default_font, before the first view. Returns false if a font was already set.