Repository navigation
fix(core): reset.css leaves hidden="until-found" content findable - #7520
Conversation
The reset's `:where([hidden]) { display: none }` also matched
`hidden="until-found"`. The browser renders that state with
`content-visibility: hidden`, which find in page and text fragment links
can search and reveal; `display: none` took the content out of both, so a
link to text inside a collapsed section scrolled nowhere and fired no
`beforematch`.
The rule now skips the until-found state
(`:where([hidden]:not([hidden='until-found' i]))`), which is how the HTML
Standard's own rendering rules split the two. Plain `hidden` elements keep
`display: none`, still in `@layer reset`. A browser without until-found
support treats the value as plain `hidden`, and its own `[hidden]` rule
still hides it.
The GitHub Pages landing serves a byte-identical copy of the file, which
its test requires to match, so the copy and its manifest hash move with it.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression44 of 454 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 24 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
No blocking issues found: narrowing the reset's [hidden] rule restores the browser's own hidden="until-found" rendering, and the new browser spec passes in Chromium and WebKit with this change and fails with the current reset, while plain hidden stays display: none. Nothing else is required. Optionally, the changeset could note that an until-found element with its own padding, border or background now shows that empty box while collapsed, as it does without the reset.
[Automated review]
cixzhang
left a comment
There was a problem hiding this comment.
CodeBunny approved at this head; review text read, no blocking notes. Approved.
… set
The reset's `:where([hidden]) { display: none }` had zero specificity in
the lowest layer, so any `display` from a class, a later layer, an
unlayered rule or an inline style beat it and the hidden element showed:
`<div hidden class="flex">` computed `display: flex` in Chromium and
WebKit. Astryx's own BottomSheet, DropdownMenuSubMenu and menu drill-in
wrapper each pair `hidden` with a separate `display: none` class for that
reason.
The rule is now `display: none !important`, which in the lowest layer
outranks every later layer and unlayered rule; an inline `!important`
style still wins. Tailwind Preflight and Bootstrap Reboot, which the file
names as models, do the same. The selector already skips
`hidden="until-found"` (meta#7520), so the `!important` cannot take that
content out of find in page.
Pages that show an element carrying `hidden` through their own `display`
will now hide it, so the changeset is [breaking] (spec:AST-017 FR32) and
names the migration. `check:changesets` rejects it while main declares a
patch, so this commit skipped the pre-commit hook after its other steps
ran by hand.
The GitHub Pages landing serves a byte-identical copy of the file, which
its test requires to match, so the copy and its manifest hash move with it.
… set
The reset's `:where([hidden]) { display: none }` had zero specificity in
the lowest layer, so any `display` from a class, a later layer, an
unlayered rule or an inline style beat it and the hidden element showed:
`<div hidden class="flex">` computed `display: flex` in Chromium and
WebKit. Astryx's own BottomSheet, DropdownMenuSubMenu and menu drill-in
wrapper each pair `hidden` with a separate `display: none` class for that
reason.
The rule is now `display: none !important`, which in the lowest layer
outranks every later layer and unlayered rule; an inline `!important`
style still wins. Tailwind Preflight and Bootstrap Reboot, which the file
names as models, do the same. The selector already skips
`hidden="until-found"` (meta#7520), so the `!important` cannot take that
content out of find in page.
Pages that show an element carrying `hidden` through their own `display`
will now hide it, so the changeset is [breaking] (spec:AST-017 FR32) and
names the migration. `check:changesets` rejects it while main declares a
patch, so this commit skipped the pre-commit hook after its other steps
ran by hand.
The GitHub Pages landing serves a byte-identical copy of the file, which
its test requires to match, so the copy and its manifest hash move with it.
… set
The reset's `:where([hidden]) { display: none }` had zero specificity in
the lowest layer, so any `display` from a class, a later layer, an
unlayered rule or an inline style beat it and the hidden element showed:
`<div hidden class="flex">` computed `display: flex` in Chromium and
WebKit. Astryx's own BottomSheet, DropdownMenuSubMenu and menu drill-in
wrapper each pair `hidden` with a separate `display: none` class for that
reason.
The rule is now `display: none !important`, which in the lowest layer
outranks every later layer and unlayered rule; an inline `!important`
style still wins. Tailwind Preflight and Bootstrap Reboot, which the file
names as models, do the same. The selector already skips
`hidden="until-found"` (meta#7520), so the `!important` cannot take that
content out of find in page.
Pages that show an element carrying `hidden` through their own `display`
will now hide it, so the changeset is [breaking] (spec:AST-017 FR32) and
names the migration. `check:changesets` rejects it while main declares a
patch, so this commit skipped the pre-commit hook after its other steps
ran by hand.
The GitHub Pages landing serves a byte-identical copy of the file, which
its test requires to match, so the copy and its manifest hash move with it.
… set
The reset's `:where([hidden]) { display: none }` had zero specificity in
the lowest layer, so any `display` from a class, a later layer, an
unlayered rule or an inline style beat it and the hidden element showed:
`<div hidden class="flex">` computed `display: flex` in Chromium and
WebKit. Astryx's own BottomSheet, DropdownMenuSubMenu and menu drill-in
wrapper each pair `hidden` with a separate `display: none` class for that
reason.
The rule is now `display: none !important`, which in the lowest layer
outranks every later layer and unlayered rule; an inline `!important`
style still wins. Tailwind Preflight and Bootstrap Reboot, which the file
names as models, do the same. The selector already skips
`hidden="until-found"` (meta#7520), so the `!important` cannot take that
content out of find in page.
Pages that show an element carrying `hidden` through their own `display`
will now hide it, so the changeset is [breaking] (spec:AST-017 FR32) and
names the migration. `check:changesets` rejects it while main declares a
patch, so this commit skipped the pre-commit hook after its other steps
ran by hand.
The GitHub Pages landing serves a byte-identical copy of the file, which
its test requires to match, so the copy and its manifest hash move with it.
User impact
Apps that load
@astryxdesign/core/reset.csscannot usehidden="until-found". The reset's:where([hidden]) { display: none }matches it too, so find in page and text fragment links never find collapsed content, and the browser never reveals it. In Chromium 149 and WebKit 26.5, a#:~:text=link to text in an until-found section scrolls nowhere and fires nobeforematch.Problem and solution fit
content-visibility: hidden, which keeps the content searchable. The reset's author rule wins over that and removes the content from layout and from search.<details>for find in page.Expected behavior and authority
hiddenattribute: until-found content is revealed by find in page and fragment navigation, withbeforematch. Its rendering section pairs[hidden]:not([hidden=until-found i])withdisplay: noneand[hidden=until-found i]withcontent-visibility: hidden.No record governs
reset.css.Smallest restoration
reset.css: the selector becomes:where([hidden]:not([hidden='until-found' i])), still in@layer reset. Plainhiddenkeepsdisplay: none.pages-landing.test.mjsrequires to match.No API change.
[fix], patch: the HTML Standard defines what until-found does, and no valid use of it relies on the content being unfindable. A browser without until-found support treats the value as plainhidden, which its own[hidden]rule still hides. No Astryx component uses until-found today.Evidence
main's reset, the until-found element computesdisplay: none; after the text fragment navigation, the attribute stays,beforematchnever fires and the page does not scroll.display: blockwithcontent-visibility: hidden; the navigation removes the attribute, firesbeforematchand scrolls the content into view.hiddencontent staysdisplay: noneand out of reach.reset.until-found.a11y.browser.spec.ts(both tests fail onmainin both engines) and a static guard inreset.until-found.test.ts(fails onmain).Scope
Testing
pnpm exec playwright test packages/core/src/reset.until-found.a11y.browser.spec.ts --project=chromium(Chromium 149) and--project=webkit(WebKit 26.5, run locally): 2 passed each. Withmain'sreset.css, both tests fail in both engines. CI runs Chromium only.pnpm vitest run packages/core/src/reset.until-found.test.ts packages/core/src/reset.test.ts .github/scripts/pages-landing.test.mjs: 16 passed; the new guard fails withmain'sreset.css.eslint --max-warnings=0on the new files,pnpm -F @astryxdesign/core typecheck,pnpm check:changesetsand the pre-commitcheck:repoare clean.