Expand description
The theme: palette + sizing tokens + color scheme, exposed as a gpui
Global so any component can resolve themed values during render.
Mirrors Mantine’s MantineProvider model — a single source of truth for
colors, spacing, radius and typography, with semantic colors derived from
the active light/dark ColorScheme.
Structs§
- Color
- An opaque 24-bit color.
- CssColor
Error - Returned when a CSS color string can’t be parsed.
- Overrides
- Per-theme semantic color overrides (opaque).
Nonemeans “use the scheme-derived default”. Populated via theTheme::with_*builders. - Palette
- The full set of named colors. Resolved by
ColorName. - Scale
- Five px values addressed by
Size. Used for spacing, radius and font. - Shades
- A 10-step shade ramp for a single named color.
- Theme
- The active theme. Install once with
Theme::init, read withtheme.
Enums§
- Color
Name - One of the named colors in the theme palette.
- Color
Scheme - Light or dark surface treatment. Drives every semantic color.
- Size
- A named size on the
xs..xlscale. The library default isMd.
Functions§
- css
- Parse a CSS color string into an
Hsla. - hsl
- An opaque color from hue (degrees) and saturation/lightness (
0..=100). - hsla
- A color from hue (degrees), saturation/lightness (
0..=100), and alpha. - mantine
- The default Mantine palette.
- rgb
- An opaque color from 8-bit channels.
- rgba
- A color from 8-bit channels plus alpha in
0.0..=1.0. - theme
- Read the active theme. Panics if
Theme::initwas never called.