|
| void | idunn_theme_default (idunn_theme_t *theme) |
| | the default theme: dark, rose, 13 px text, 6 px radius.
|
| void | idunn_theme_from_conf (idunn_theme_t *theme, const conf_t *conf) |
| | a theme from a theme file (or from text, for tests); missing or bad values keep their defaults.
|
| void | idunn_theme_load (idunn_theme_t *theme) |
| | read the user's theme (conf_open("theme")).
|
| bool | idunn_theme_fit (idunn_theme_t *theme, int32_t screen_width) |
| | set the scale for a screen when the theme's scale is auto.
|
| const char * | idunn_color_name (idunn_color_t which) |
| | the name of a colour token in the theme file ("muted-foreground"), or NULL.
|
| int32_t | idunn_radius (const idunn_theme_t *theme) |
| | buttons, inputs, list rows
|
| int32_t | idunn_radius_sm (const idunn_theme_t *theme) |
| | check boxes, small items in menus: half the radius
|
| int32_t | idunn_radius_lg (const idunn_theme_t *theme) |
| | cards, dialogs, popovers, windows: the radius + 4
|
| idunn_text_style_t | idunn_text_style (const idunn_theme_t *theme, idunn_text_t which) |
| | a text style at the theme's font size and scale.
|
| int | idunn_shadow (const idunn_theme_t *theme, idunn_shadow_t which, gfx_shadow_t layers[IDUNN_SHADOW_LAYERS]) |
| | the layers of a shadow, in the order to draw them (the CSS list from its end), at the theme's scale.
|
idunn: the design tokens (colours, sizes, text styles, shadows).
the tokens are the only place colours and sizes are written: widgets and heimdalld use token names, never numbers. the values follow the agreed look (plans/idunn-ui-plan.md, section 2), shadcn's "zinc" theme with the user's accent colour.
the theme file (/etc/ginnos/theme.conf and ~/.config/ginnos/theme.conf) has these keys in [theme]: mode (light or dark), accent (rose, blue, green, orange, violet, neutral, or #rrggbb), font_size (13 to 15; all text styles follow), scale (1 or 2), motion (true or false) and radius (4 to 12; the small and large radii follow). the sections [light] and [dark] can change any colour token for that mode, by its name: "border = #ffffff1a".