Repository navigation
feat(native): upgrade GPUI THEME_CSS_HOOKS compiler and renderer for Kraken themes - #473
Merged
Merged
Conversation
…Kraken themes
Upgrades the native theme CSS slot compiler and GPUI rendering engine so custom themes like kraken-glass and kraken-kinetic translate faithfully:
- Adds SettingsGroup, SwitchThumb, and Checkbox slots (keeping all 29 canonical THEME_CSS_HOOKS intact), plus input-control, select-popup > .dropdown-glass, and sidebar > * aliases.
- Supports substring/prefix/suffix attribute qualifiers ([class*="border-input"]), :root.dark / :root:not(.dark), complex :is(...) / :has(...) selected thread selectors without clobbering inner descendants, SlotState::{Selected, Unchecked, FocusWithin}, state-scoped CSS vars, ::before SlotPseudoBar accent bars, and calc(100% - <px>) floating inset sizing.
- Parses multi-stop linear gradients, elliptical radial gradients (preserving underlay background-color), and background-clip: padding-box, border-box prismatic border_gradient rims, rendered via a cached 128x128 BGRA8 GPU texture rasterizer.
- Extracts theme CSS font stacks (--font-sans, --font-mono, body/html font-family) and local data: @font-face payloads (decoding WOFF2/WOFF via wuff and registering deduplicated SFNT bytes into GPUI TextSystem).
- Wires new states, floating sidebar card sizing, prismatic rims, and ::before bars cleanly across workspace, sidebar, composer, settings controls, dialogs, menus, popovers, tooltips, transcript bubbles/code blocks, and thread details without duplicate hover panics.
…under 2-stop gradients
This was referenced Nov 20, 2026
Open
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.
Problem
Custom CSS themes such as
kraken-glassandkraken-kineticonly partially translated to the native GPUI client because the slot compiler rejected compound attribute qualifiers ([class*="border-input"]), complex active/selected selectors (:is(...),:has(...),::before),calc(100% - <px>)floating card sizing, multi-stop linear gradients, radial gradients,background-clip: padding-box, border-boxprismatic rims, and embeddeddata:@font-facepayloads.Solution
crates/core/src/themes/slots.rs):SettingsGroup,SwitchThumb, andCheckboxslots while preserving all 29 canonicalTHEME_CSS_HOOKSin order; added selector aliases (input-control,select-popup/select-popup > .dropdown-glass,sidebar > *).AttrOpsupport for*=,^=, ``,~=, `|=` qualifiers, `:root.dark` / `:root:not(.dark)`, `SlotState::{Selected, Unchecked, FocusWithin}`, complex `:is(...)` / `:has(...)` / `:is(...) > [data-thread-item]` matching (without clobbering inner descendant resets), state-scoped `SlotVarDecl`, `::before` `SlotPseudoBar`, and `SlotLength::FullMinusPx(f32)`.background-image/background,background-clip: padding-box, border-box->border_gradient, ellipticalradial-gradient(...), and preserved underlaybackground_colorbeneath gradient layers.crates/app/src/theme/slots.rs):linear-gradientand ellipticalradial-gradient.border_gradientprismatic rims (outer rounded gradient + inset inner padding-box fill),SlotPseudoBar(::before), and state-aware background layers cleanly without wash-out.SidebarInnerinset sizing (workspace.rs,sidebar/mod.rs), selectedThreadItemrim +::beforebar (sidebar/row.rs), focusedComposerHosthalo (composer/view.rs),Switch/SwitchThumb/Select/SettingsGroup/DialogFrame/Tooltip(settings/controls.rs),Checkbox/Tooltip(composer/controls.rs), dialogs, menus, popovers, transcript bubbles/code blocks, and thread details without duplicate.hover(...)panics.@font-face(crates/core/src/themes/css.rs,crates/app/src/theme/mod.rs):--font-sans,--font-mono,body/htmlfont-familydefaults (yielding to explicit user typography settings) and localdata:@font-facepayloads, decoding WOFF2/WOFF viawuffand registering deduplicated SFNT bytes into GPUI'sTextSystemwithFontInventoryrefresh.Verification
CARGO_INCREMENTAL=0 cargo clippy --manifest-path apps/native/Cargo.toml --workspace --all-targets -- -D warnings: PASS (0 warnings)CARGO_INCREMENTAL=0 T3_NATIVE_HOME=$(mktemp -d) cargo test --manifest-path apps/native/Cargo.toml -p t3-core --lib themes: 74 passed, 0 failedCARGO_INCREMENTAL=0 T3_NATIVE_HOME=$(mktemp -d) cargo test --manifest-path apps/native/Cargo.toml -p t3-native -- --test-threads=1: 241 passed, 1 unrelated failure (onboarding::tests::onboarding_rpc_retries_ambiguous_creates_and_partial_history_without_duplicates, missingnode_modules/.pnpmin Rust-only worktree)