Repository navigation
Theme: one Tokens type, shadcn's, in core (#497 stage 1) - #498
Merged
Merged
Conversation
Stage 1 of the shadcn-only epic starts by moving the token types, so the
one Tokens type can live where Style and every rule body are. Tokens,
Palette, BaseColor, ThemeColor, ShadcnStyle, Elevation, HoverSurface,
FontSet and the contrast check move from eggshell-ui-shadcn into
eggshell_ui::theme unchanged; the shadcn crate re-exports them, so
downstream paths keep working until the crate split.
The bundled Geist moves to src/fonts with its licence. Core grows a
`fonts` feature (off by default) for it; the shadcn crate's `fonts`
feature, still on by default, now forwards to it.
The items the preset reached as crate-private become public:
FontSet::{declared, install, inserts}, Elevation::shadow and
theme::warn_low_contrast.
No behaviour change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
Style::tokens is now theme::Tokens, shadcn's set, and every rule body (`Fn(Tw, &Tokens) -> Tw`) and reader takes it. Core's 32-field contract::Tokens, Tokens::from_egui and the preset's core_tokens bridge are deleted; the preset hands Style its own tokens. The fields core had that shadcn's did not: - The four egui-only ones go; readers take what core_tokens mapped them from, so preset values are unchanged: control_height -> control_height(), button_padding -> points_vec(button_padding) (now spacing units), text_size -> control_text_size().size, switch_thumb -> points(switch_thumb). - focus becomes Tokens::focus(), computed from ring_width and ring/50, which is what the preset set it to; a field could drift from them. Tests that override the ring set ring and ring_width. - disabled stays, as a field of the one Tokens (default Colors): eggshell's own, like success and warning. Style::from_egui keeps filling its sections from egui; its tokens are shadcn Vega neutral light (Tokens::light()). Without a preset that moves the token-read values: a mount's bare padding (focus clearance 4 -> 6), the Defaults-layer rule colours, and egui_look's input. Under the preset nothing changes, and no golden moved. The importer reads the colour token names from src/theme/tokens.rs; the regenerated sheets are byte-identical. Tests changed, none deleted: egui_look::the_core_tokens_are_the_preset_s becomes the_style_s_tokens_are_the_preset_s (whole equality); ring overrides in field_box, owned_choice and owned set ring/ring_width; egui_look and sheet tests set control_units / text.sm instead of the egui-only fields; density compares button padding in points. Breaking: eggshell_ui::contract::Tokens and Tokens::from_egui are gone (use eggshell_ui::theme::Tokens); Tokens::focus is a method. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 1 of #497, the shadcn-only epic: one
Tokenstype.What changes
eggshell_ui::theme. The moves aregit mvs, so history is kept, andeggshell-ui-shadcnre-exports every type. The types areTokens,Palette,BaseColor,ThemeColor,ShadcnStyle,Elevation,HoverSurface,FontSet,ContrastPair,ContrastRatioandRegistryMiss.contract::Tokensand itsfrom_eguiare deleted, along with the preset's privatecore_tokensbridge. Every rule body now reads the one type.control_height→control_height()button_padding→points_vec(button_padding)text_size→control_text_size().sizeswitch_thumb→points(switch_thumb)focusis now the methodTokens::focus(), computed fromring_widthandringat half opacity.disabledstays a field, defaulting toDisabled::Colors.src/fonts/. Core gains afontsfeature, off by default; the shadcn crate'sfontsfeature enables it.src/theme/tokens.rs. The regenerated sheets are byte-identical.Style::from_egui's tokens are now Vega neutral light. Its sections still come from egui until stage 2.Checks
cargo xtask integrate: green.tests/snapshots.Public API
contract::Tokensand itsfrom_egui.thememodule;Tokens::focus();Tokens::disabled;FontSet::declared,installandinserts,Elevation::shadowandtheme::warn_low_contrast, which were crate-private in the shadcn crate.Prose
Left for the user:
TODO(prose)docs on thethememodule,Elevation::shadow,Tokens::focusandTokens::disabled;🤖 Generated with Claude Code
https://claude.ai/code/session_01PWiKKfuwuKXZxdwsSBxd76