Skip to content

experimental theme: a resting background color, outline or shadow keeps a part's hover and keyboard focus visible - #13464

Closed
josephfarina wants to merge 4 commits into
mainfrom
josephfarina/editor-rest-look-keeps-states-main
Closed

josephfarina wants to merge 4 commits into
mainfrom
josephfarina/editor-rest-look-keeps-states-main

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Returns #13235 against main with the fixes from its review folded in (#13293, #13357, #13390), as one change.

User impact

astryx experimental theme editor set: a setting that changes a part's resting look hid its hover or keyboard focus. Examples: background on a button wiped Core's hover and press layer; a resting shadow covered the focus ring; outline none removed the focus outline.

Now:

  • Under a resting background color shorthand, the part's hover and press layer comes back from Core, under Core's own conditions: no press layer on a disabled part, and no hover left on a touch screen after a tap. A background with its own image (a gradient, url(), image-set()) keeps that image in every state, and a part whose resting image is Core's own tint (AvatarGroup's overflow) gets no overlay back.
  • Core's focus and hover rings are drawn over a resting shadow.
  • Under a resting outline, outline-style or outline-width, the part's focus state gets Core's focus outline back.
  • A state the theme sets itself stays as set. That covers a hover or press background or a focus outline property set for that scope or a wider one (the whole part, one variant), or for one mode in that mode.
  • Under a resting look for a variant and a size (--when variant:ghost+size:sm), a wider focus outline is copied per property, and a property that scope sets itself stays. For example, a small ghost keeps its own green ring color and gets the ghost's solid 2px ring.

Smallest restoration

  • packages/cli/api/theme-edit/_settings.mjs: withOverlayStates (revert-layer for hover and press), withFocusOutline (Core's focus values, and the theme's own and wider values), and shadow ring order.
  • packages/cli/api/theme-edit/theme-rest-look-keeps-hover-and-focus.test.mjs and five existing tests updated for the ring order.
  • .changeset/experimental-theme-rest-look-keeps-hover-focus.md: the release note.

Not split: the review fixes change the same two functions as the original change. Landing them apart would ship the regressions they fix. The code is about 300 lines; the rest is tests.

Evidence

  • packages/cli/api/theme-edit/theme-rest-look-keeps-hover-and-focus.test.mjs (24 cases)
  • The whole packages/cli/api/theme-edit suite passes.

Scope

Components: none (experimental theme editor only)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

replay: worse 0 at ee9e702 (carried from 17cdf0f: release-note text only)

preflight: pass ee9e702 (carried from 17cdf0f: release-note text only) (CI half pass; review: astracat at this head)

…s its hover and keyboard focus visible

Folds in the fixes from review: Core's own hover, press and focus come back under a resting background or outline, under Core's disabled and touch conditions; a state the theme sets for that scope, a wider one, or one mode stays; a wider focus outline is copied per property under a resting look for a variant and a size, keeping what that scope sets itself.
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 21, 2026 10:15pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 21, 2026
@astracat-bot

astracat-bot Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 21, 2026, 10:44 PM UTC

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec f41fc0a

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · ee9e702

Storybook · Sandbox · built from this PR's head

Current run: The current CI run concluded cancelled. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the restore works for the cases it covers, and two small fixes are needed before it lands.

  • The changeset and title say any resting setting keeps hover and keyboard focus visible, but only a background color shorthand, outline / outline-style / outline-width and a shadow on a ringed part are handled (a gradient background, background-image: none or outline-color: transparent still hide them), so please name those three settings and say that a background with its own image keeps that image in every state.
  • The image check at packages/cli/api/theme-edit/_settings.mjs:7634 misses image-set("…"), so a resting image-set() background is replaced by Core's overlay on hover and press; reusing the gradient( / url( / image-set( test from line 7503, with a test beside the gradient case, fixes it.

Also worth a look, non-blocking: the touch press fade ([data-astryx-press="fading"]) is still masked by a resting background shorthand, and a revert-layer for that state would hand it back to Core.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the editor keeps hover and keyboard focus visible whenever a setting changes a part's resting look. False: only three settings are handled; a gradient background, background-image: none and outline-color: transparent still hide them.
  • Claim: a resting background shorthand gives back Core's hover and press layer under Core's conditions. Verified for a color background (new tests and generated CSS); false for gradient, url() and image-set() backgrounds.
  • Claim: Core's focus and hover rings draw over a resting shadow. Verified (_settings.mjs:8102 and the ring tests).
  • Claim: a resting outline gives the focus state Core's focus outline back. Verified (new outline tests).
  • Claim: a hover, press or focus outline the theme sets for that scope, a wider one, or one mode stays as set. Verified (new tests).
  • Claim: under a variant-and-size resting look, a wider focus outline is copied per property and the scope's own property stays. Verified (the small ghost green ring test).
  • Claim: on main, a resting background, a resting shadow or outline: none hid hover, press or focus. Verified: 14 of the 22 new cases fail on main.
  • Claim: no press layer on a disabled part and no hover left after a tap. Verified: the restored states fall back to Core's own enabled and hover-capable rules.
  • Claim: the new test file has 22 cases. Verified.
  • Claim: the whole theme-edit suite passes. Partly checked: the 81 related theme-edit test files pass at this head.
  • Claim: no new public API. Verified.
  • Claim: the code is about 300 lines. Verified (289 added, 4 removed).
  • .changeset/experimental-theme-rest-look-keeps-hover-focus.md: release note overclaims (blocking).
  • packages/cli/api/theme-edit/_settings.mjs: image-set() guard (blocking); touch press fade (non-blocking).
  • packages/cli/api/theme-edit/theme-rest-look-keeps-hover-and-focus.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-resting-shadow-part-rings.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-part-state-wins-build.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-part-text-sits-core.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-state-part-states-changed.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-titles-shadows-alpha-state.test.mjs: clear.

Automated review (maintainer link)

);
});
};
for (const state of ['hover', 'active']) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: Core also paints the press overlay on [data-astryx-press="fading"] while a touch press releases. The resting shorthand still masks that state, so the overlay cuts off instead of fading; a revert-layer for it too would hand it back to Core.

… the release note names the three settings

Review findings on #13464: image-set() joins gradient and url() as a background with its own image, which keeps it in every state; the release note and title name the resting settings handled (background color shorthand, outline, a shadow on a ringed part).
@josephfarina josephfarina changed the title experimental theme: a setting that changes a part's resting look keeps its hover and keyboard focus visible experimental theme: a resting background color, outline or shadow keeps a part's hover and keyboard focus visible Nov 21, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec e102173

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the release note and the image-set() guard are fixed, and one restore case still needs a fix before this lands.

  • Miss: a resting background on AvatarGroup's overflow (background #ff0000 --on avatar-group-overflow) now gets background-image: revert-layer in its hover and press rules, and Core's base value there includes the overflow's own neutral tint, so the theme's color takes that tint under the pointer, even on the non-interactive +N indicator (packages/cli/api/theme-edit/_settings.mjs:7733-7778); skipping the restore for a part whose Core resting background-image is not none (or writing only Core's overlay layer there, under Core's hover media and enabled guard), with a test on avatar-group-overflow, fixes it.

Also worth a look, non-blocking: the touch press fade ([data-astryx-press="fading"]) is still masked by a resting background shorthand, and the description's "22 cases" is 23 at this head.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim: the editor keeps hover and keyboard focus visible under three resting settings. Verified (_settings.mjs:7629-7637).
  • Claim: a resting background color shorthand gives back Core's hover and press layer under Core's own conditions (no press layer on a disabled part, no hover after a tap). Verified for parts whose resting look has no image of Core's (tests for the disabled press and the touch hover, and the generated selectors); false for AvatarGroup's overflow (the blocking finding).
  • Claim: a background with its own image (gradient, url(), image-set()) keeps that image in every state. Verified (_settings.mjs:7634; the new image test fails with the previous guard and passes here).
  • Claim: a resting outline, outline-style or outline-width gives the focus state Core's focus outline back. Verified (new outline tests).
  • Claim: Core's focus and hover rings are drawn over a resting shadow on a ringed part. Verified (_settings.mjs:8102 and the ring tests).
  • Claim: a hover, press or focus outline the theme sets for that scope, a wider one, or one mode stays as set. Verified (new tests).
  • Claim: under a variant-and-size resting look, a wider focus outline is copied per property and the scope's own property stays. Verified (the small ghost green ring test).
  • Claim: on main, a resting background, a resting shadow or outline: none hid hover, press or focus. Verified (the base compiles only the resting rule; the new cases fail there).
  • Claim: the change is the two functions, the shadow order, the new test file, five updated tests and the release note, about 300 lines of code. Verified (289 added, 4 removed in _settings.mjs).
  • Claim: the new test file has 22 cases. False: it has 23 at this head (non-blocking).
  • Claim: the whole theme-edit suite passes. Partly checked: the six changed test files and the 65 theme-edit test files that set a background, outline or shadow pass at this head.
  • Claim: no components and no new public API. Verified.
  • .changeset/experimental-theme-rest-look-keeps-hover-focus.md: accurate apart from "Core's own conditions" for AvatarGroup's overflow (the blocking finding).
  • packages/cli/api/theme-edit/_settings.mjs: AvatarGroup overflow tint (blocking); touch press fade (non-blocking).
  • packages/cli/api/theme-edit/theme-rest-look-keeps-hover-and-focus.test.mjs: clear (no AvatarGroup overflow case yet).
  • packages/cli/api/theme-edit/theme-resting-shadow-part-rings.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-part-state-wins-build.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-part-text-sits-core.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-state-part-states-changed.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-titles-shadows-alpha-state.test.mjs: clear.

Automated review (maintainer link)

…nt gets no overlay back

Review finding on #13464: a resting background on AvatarGroup's overflow got revert-layer in its hover and press rules, so Core's neutral tint came back under the pointer. A part whose plain resting background-image (not under an attribute state) is not none now gets no overlay restore.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 17cdf0f

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the AvatarGroup overflow tint is fixed, and the release note needs one clause to match that fix.

  • Regression: the release note (.changeset/experimental-theme-rest-look-keeps-hover-focus.md) says a resting background color shorthand gives the part's hover and press layer back, but the new skip in packages/cli/api/theme-edit/_settings.mjs:7736-7747 (asserted by the test at theme-rest-look-keeps-hover-and-focus.test.mjs:540) leaves AvatarGroup's clickable +N with no hover or press under background … --on avatar-group-overflow, exactly as on main, so add the description's own clause, "a part whose resting image is Core's own tint (AvatarGroup's overflow) gets no overlay back", to that sentence.

Also worth a look, non-blocking: the touch press fade ([data-astryx-press="fading"]) is still masked by a resting background shorthand.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim: the editor keeps hover and keyboard focus visible under three resting settings. Verified for the settings and parts tested (_settings.mjs:7629-7637).
  • Claim: a resting background color shorthand gives the part's hover and press layer back from Core under Core's own conditions (no press layer on a disabled part, no hover after a tap). Verified for the button and calendar day (tests and compiled CSS); false for AvatarGroup's overflow, which now gets nothing back (the blocking finding).
  • Claim: a background with its own image (gradient, url(), image-set()) keeps that image in every state. Verified (_settings.mjs:7634; test at line 550 of the new test file).
  • Claim: a part whose resting image is Core's own tint (AvatarGroup's overflow) gets no overlay back. Verified (_settings.mjs:7736-7747; the new test fails on the previous revision and passes here; the compiled CSS for that part now matches main's).
  • Claim: a resting outline, outline-style or outline-width gives the focus state Core's focus outline back. Verified (outline tests).
  • Claim: Core's focus and hover rings are drawn over a resting shadow on a ringed part. Verified (_settings.mjs:8117 and the ring tests).
  • Claim: a hover, press or focus outline the theme sets for that scope, a wider one, or one mode stays as set. Verified (tests).
  • Claim: under a variant-and-size resting look, a wider focus outline is copied per property and the scope's own property stays. Verified (the small ghost green ring test).
  • Claim: on main, a resting background, a resting shadow or outline: none hid hover, press or focus. Verified (main compiles only the resting rule).
  • Claim: the change is the two functions, the shadow order, the new test file, five updated tests and the release note, about 300 lines of code. Verified (304 added, 4 removed in _settings.mjs; five test files updated).
  • Claim: the new test file has 24 cases. Verified.
  • Claim: the whole theme-edit suite passes. Partly checked: the six changed test files and the 64 theme-edit test files that set a background, outline or shadow pass.
  • Claim: no components and no new public API. Verified.
  • .changeset/experimental-theme-rest-look-keeps-hover-focus.md: the AvatarGroup overflow exception is missing (blocking).
  • packages/cli/api/theme-edit/_settings.mjs: clear apart from the touch press fade (non-blocking).
  • packages/cli/api/theme-edit/theme-rest-look-keeps-hover-and-focus.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-resting-shadow-part-rings.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-part-state-wins-build.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-part-text-sits-core.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-state-part-states-changed.test.mjs: clear.
  • packages/cli/api/theme-edit/theme-titles-shadows-alpha-state.test.mjs: clear.

Automated review (maintainer link)

Review finding on #13464: the release note now says a part whose resting image is Core's own tint (AvatarGroup's overflow) gets no overlay back, as the code and description do. Text only.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec ee9e702

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet.

The release note now names the AvatarGroup overflow exception, which was the last blocking point, and the code is unchanged since the previous review. One optional follow-up: under a resting background color the touch press fade ([data-astryx-press="fading"]) is still masked, so the restored press overlay cuts off instead of fading on touch screens; a revert-layer for that state would hand it back to Core.

Claims and files checked

Review mode: incremental; reason: none

  • Claim: a resting background color shorthand gives the part's hover and press layer back under Core's own conditions (no press layer when disabled, no hover after a tap): verified, _settings.mjs:7631-7636 and :7788, tests for the ghost hover and press, the disabled press and the touch hover.
  • Claim: a background with its own image (gradient, url(), image-set()) keeps that image in every state: verified, _settings.mjs:7634, test for a gradient and an image-set().
  • Claim: a part whose resting image is Core's own tint (AvatarGroup's overflow) gets no overlay back: verified, _settings.mjs:7736-7747, test at theme-rest-look-keeps-hover-and-focus.test.mjs:540.
  • Claim: a resting outline, outline-style or outline-width gives the focus state Core's focus outline back: verified, _settings.mjs:7629-7630 and :7955-7983, test at :82.
  • Claim: Core's focus and hover rings are drawn over a resting shadow on a ringed part: verified, _settings.mjs:8117, theme-resting-shadow-part-rings.test.mjs including the deep-bevel case.
  • Claim: a hover or press background or focus outline property the theme sets for that scope, a wider one, or one mode stays as set: verified, _settings.mjs:7758-7793 and :7824-7845, tests at :97, :114, :129, :465, :484, :503, :522, :562.
  • Claim: under a variant-and-size resting look a wider focus outline is copied per property and the scope's own property stays: verified, _settings.mjs:7886-7954, tests at :182, :205, :238, :280, :308.
  • Claim: the change returns the earlier merged editor change against main with its three follow-up fixes folded in: consistent, the earlier pull request merged into the editor feature branch and the three follow-ups are closed unmerged with matching titles.
  • Claim: on main a resting background wiped the hover and press layer, a resting shadow covered the focus ring and outline none removed the focus outline: verified, main's compile step has neither restore and writes the shadow before the ring, and the theme layer sits above Core's (packages/core/src/reset.css:40).
  • Claim: 24 new cases, five existing test files updated for the ring order, about 300 lines of code: verified, 24 cases all passing, five files, +304/−4 in _settings.mjs.
  • Claim: the theme-edit suite passes: verified, all 561 test files under packages/cli/api/theme-edit pass at this head (6,134 tests passed, 4 skipped).
  • Claim: no component and no public API changes, and this head changes only the release note since the previous one: verified, the CLI's exports, bin and command docs are unchanged and the only commit since edits one changeset line.
  • File .changeset/experimental-theme-rest-look-keeps-hover-focus.md: clear.
  • File packages/cli/api/theme-edit/_settings.mjs: clear, with the non-blocking touch press fade note.
  • File packages/cli/api/theme-edit/theme-rest-look-keeps-hover-and-focus.test.mjs: clear.
  • File packages/cli/api/theme-edit/theme-resting-shadow-part-rings.test.mjs: clear.
  • Files theme-part-state-wins-build.test.mjs, theme-part-text-sits-core.test.mjs, theme-state-part-states-changed.test.mjs, theme-titles-shadows-alpha-state.test.mjs: clear, each follows the new ring order.

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 22, 2026
- #13358 fix(cli): a theme family checks its compiled registries as plain Node loads them
  Author: @josephfarina
- #13388 fix(cli): --check reads a theme family's committed compiled registries
  Author: @josephfarina
- #13464 experimental theme: a resting background color, outline or shadow keeps a part's hover and keyboard focus visible
  Author: @josephfarina
- #13433 cli(icons): icon response types say "icon meaning" and "variant"
  Author: @josephfarina
- #13456 feat(templates): dashboard-scorecard shows two headline numbers per row on a phone when they fit
  Author: @josephfarina
- #13473 docs(icons): icon-set guide's relatives line; template icons say icon component
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #13542.

@github-actions
github-actions Bot deleted the josephfarina/editor-rest-look-keeps-states-main branch November 23, 2026 06:06

This branch was successfully deployed

1 active deployment
Preview — ee9e7028 Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant