Files
jyviko 312454f899 Look: SolidCraft's icons, glyphs, UI fonts and themes as the shared crate solidcraft-look (follows #14251) (#14578)
* UI kit: an icon set can extend another host's masters with a host's own

IconSet::extended(data, extension) draws another host's IconData (the same
static tables, not a copy) with an IconExtension of the host's own masters,
aliases and default accents, in the data's colour roles and accents. For a
name both have the extension's master, alias or default accent wins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M2MmcDrkcWhQeHS2K8

* Look: SolidCraft's icons, glyphs, UI fonts and built-in themes are the shared crate solidcraft-look

The icon masters and their build step, the code-drawn glyph painters, the UI fonts and the
built-in themes move into crates/look with history. SolidCraft's app installs its look from
the crate, as another app can. The workspace tab table stays the app's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M2MmcDrkcWhQeHS2K8

* Look: the end-cap icons' attribution rows and the style guide's path follow the move

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M2MmcDrkcWhQeHS2K8

* Licence: SolidCraft's brand and interface are under LICENSE-BRAND

The UI kit, the look (interface icons, glyphs, built-in themes), the theme's tokens and palettes,
and the SolidCraft name, logo, app icon and brand kit are SolidCraft's brand. They may be used,
changed and contributed to as part of SolidCraft; using them in another program or product needs
the maintainers' written permission. Geometry and the rest of the code stay MIT OR Apache-2.0,
and third-party fonts keep their own licences.

The three crates declare the licence with `license-file`, which `xtask shared` now accepts when
the file sits inside the crate; the generated licence list names it; ATTRIBUTION rows for the
look's artwork and the branding name it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M2MmcDrkcWhQeHS2K8

---------

Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 09:06:00 -05:00

2.2 KiB

solidcraft-theme

The token contract every UI component draws with. A component reads its colours and sizes from Tokens::get() and its tab colours from TabAccent::current(ctx); with nothing set, it draws with SolidCraft's built-in dark tokens. The crate holds no data files and knows no theme-file format, so a component vendored into another app draws with that app's tokens and needs no theme files, built-in themes or icon artwork.

SolidCraft's theme system (theme files, their options, the built-in themes and the per-tab surface fades) stays in the app: it resolves Tokens and hands them to this crate.

API

Item What it is
Tokens Every colour and size the UI draws with; Tokens::light() and Tokens::dark() are SolidCraft's values, written in code
Tokens::get(), Tokens::view() The tokens to draw with now (the window's, and those drawn straight onto the 3D view)
set_dark, set_vision, set_viewport_dark, set_viewport_background, set_logo_accent The thread's theme state, which the host sets every frame
set_custom, custom, scoped_tokens, scoped_panel_tokens A host's own palette in place of the built-in one, for the thread or for a scope
ColorVision Colour vision modes: a second set of values for the colours that carry a meaning
TabAccent, AccentRamp, TabTable, TabStyle A tab's selection colours, published per egui context. The theme defines the accent ramps; the host lists its tabs in a TabTable with the ramp and icon accent of each, and installs it (install_tabs, installed_tabs) for theme files keyed by tab name
set_published, PublishedTab, Environment, Surfaces, Fade A frame's per-tab palettes, as a host's theme system resolves and fades them
apply(ctx) egui's visuals and spacing from the tokens
contrast_ratio, composite, panel_surface_fill, ... WCAG contrast checks on token pairs
icon_strokes The primary strokes the tokens share with SolidCraft's icon artwork

Licence

This crate is part of SolidCraft's brand and interface, under the SolidCraft Brand and Interface Licence (LICENSE). Use it as part of SolidCraft; using it in another program or product needs the maintainers' written permission first.