Expand description
Design tokens shared by the neuro-kitchen apps, and their application to gpui-kit’s theme, so every gpui-kit component (buttons, menus, inputs, tooltips) and the apps’ own layout use one set of values.
- Spacing on the 8 px grid with a 4 px half-step:
XS4,SM8,MD12,LG16,XL24,XXL32 (designparser8pt-grid,4pt-system). - Type: base
FONT_SIZE15 px, so gpui’stext_xs≈ 11 (captions),text_sm≈ 13 (body),text_base15 (titles),text_lg≈ 17 (headings); weights 400 and 600 only. The sizes are relative to the base, so a larger base in Settings scales every one of them. - Radii by tier:
RADIUS_SM4 (chips, swatches),RADIUS6 (controls),RADIUS_LG8 (sections, panes, dialogs) (designparsercorner-radius-tone: neutral, one per tier). - Panes are rounded cards
PANE_GAPapart on the chrome, withPANE_PADDINGinside (padding ≥ 1.5 × gap: designparserpadding-gap-ratio). - Neutrals are shared plain greys (
color); the accent is the app’s (Palette) unless the user picked another colour (Look::accent, anyRgb: made to pass contrast).
The look (dark or light, palette, accent, text size) is process-wide: set it with set_look, then
apply hands it to gpui-kit and redraws every window.
Re-exports§
pub use color::Colors;pub use color::colors;pub use color::contrast;pub use color::mix;pub use color::rgb8;pub use color::rgb_hsla;pub use palette::Accent;pub use palette::Palette;pub use palette::Rgb;
Modules§
- color
- The colours: shared neutrals (plain greys: surfaces from the deepest, text, borders), status
colours and the accent (
super::Look::active_palette), resolved for the current look. - palette
- Accent colours. The neutrals are shared (
super::color); each app supplies a defaultPalette(dsp-kitchenPalette::LIME, lumenPalette::EOSIN), and the user may pick any colour instead (Rgb, stored in the app’s preferences):Palette::from_rgbturns it into light and dark accents that pass WCAG contrast.
Structs§
- Look
- What the user chose: dark or light, an accent of their own or the app’s, the base text size.
Constants§
- CONTROL_
MIN_ W - Narrowest a row’s control gets before it drops under its label (px).
- FONT_
RANGE - Smallest and largest base text size Settings may choose (px).
- FONT_
SIZE - Base text size (px) by default.
- LABEL_W
- Width of a row’s label (
crate::widgets::row) (px). - LG
- Spacing: padding of panels (px).
- MD
- Spacing: padding inside sections and boxes (px).
- PANE_
GAP - Gap between panes on the chrome (px).
- PANE_
PADDING - Padding inside a pane (px).
- RADIUS
- Corner radius of controls: buttons, inputs, menus (px).
- RADIUS_
LG - Corner radius of large things: boxed sections, panes, dialogs (px).
- RADIUS_
SM - Corner radius of small things: chips, swatches, scrub labels (px).
- SM
- Spacing: the base unit; gaps between controls and rows (px).
- TARGET_
MIN - Smallest pointer target (px): WCAG 2.2 AA (designparser
touch-target). - XL
- Spacing: between groups (px).
- XS
- Spacing: a hairline step, icon gaps (px).
- XXL
- Spacing: around page-level blocks (px).
Functions§
- apply
- Applies the current look (
set_look) and the tokens to gpui-kit’s theme, and redraws every window. - is_dark
- Whether the current look is dark.
- look
- The current look.
- set_
look - Sets the look every colour reads.
applythen hands it to gpui-kit. - sp
pxof a token.- system_
dark - Whether the system shows
windowdark (for a theme that follows the system). - use_
look - Sets the look and applies it (
set_look, thenapply).