fix(theme): make shared focus outlines themeable - #4654
Open
cixzhang wants to merge 1 commit into
Open
Conversation
cixzhang
requested review from
ejhammond,
humbertovirtudes,
imdreamrunner and
josephfarina
as code owners
August 2, 2026 15:18
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
August 2, 2026 15:18
cixzhang
force-pushed
the
fix/focus-outline-consistency
branch
from
August 2, 2026 15:29
ce99cfc to
4c808b1
Compare
cixzhang
force-pushed
the
fix/focus-outline-consistency
branch
from
August 2, 2026 21:29
4c808b1 to
1eba42f
Compare
cixzhang
commented
Aug 3, 2026
| ':active': `linear-gradient(${colorVars['--color-overlay-pressed']}, ${colorVars['--color-overlay-pressed']})`, | ||
| }, | ||
| outline: { | ||
| default: null, |
Contributor
Author
There was a problem hiding this comment.
This is kind of nice to have which is an error-specific outline color.
cixzhang
force-pushed
the
fix/focus-outline-consistency
branch
from
August 3, 2026 03:06
1eba42f to
96b7019
Compare
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.
Why
General interactive focus outlines were defined independently across components, which made small geometry/color differences easy to introduce and made product-style replication harder. This gap showed up while evaluating agentcloud and trying to replicate its styling through Astryx themes.
Astryx also has a design split: input/field focus treatments are distinct from general interactive chrome. This PR intentionally targets the general outline only.
Theme API
This PR makes the general focus outline themeable as a virtual component target:
Rendered general controls receive the shared
astryx-focus-outlineclass through the new internalfocusOutlinePropshelper, so theme overrides attach to a single shared class instead of each component reconstructing outline CSS independently.What
themeProps('focus-outline')/.astryx-focus-outline.astryx-focus-outlineas a theme target and updates the theme-build registry test so virtual non-TSX targets are discovered.Why not tokens?
Tokens would cover simple color/width/offset cases, but they do not model richer CSS treatments well: animated outlines, layered rings, or state-specific outline behavior. A virtual component-style target gives theme authors normal CSS override expressiveness without adding new outline tokens.
Open question
If we want a more guided API later, we can still add a top-level
focusOutlineconfig that compiles down to this samefocus-outlinetheme target. This PR establishes the shared class target first.Risk
Low-to-medium. The intended visual output stays the same for default themes, but the focus outline class is now shared and themeable across general controls. Inputs are intentionally unchanged.
Testing
git diff --checkpnpm -F @astryxdesign/core typecheckpnpm exec vitest run packages/cli/clients/cli/commands/build-theme.registry.test.mjspnpm check:sync && pnpm check:package-boundaries && pnpm check:changesets && pnpm check:demo-media && pnpm check:executable-bits