fix: exclude iframes from focus-visible auto outline in Preflight#20292
Conversation
Confidence Score: 5/5This looks safe to merge.
Reviews (4): Last reviewed commit: "update integration test snapshots" | Re-trigger Greptile |
| */ | ||
|
|
||
| :-moz-focusring { | ||
| :-moz-focusring:where(:not(iframe)) { |
There was a problem hiding this comment.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
WalkthroughThis change updates the Firefox focus-ring selector in 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Firefox's UA stylesheet already sets iframe:focus-visible { outline-style: none; },
so Preflight's :-moz-focusring { outline: auto; } rule overrides that and applies
an unwanted auto outline to focused iframes.
Adding :where(:not(iframe)) to the selector preserves the improved focus ring
behavior for all other elements while respecting Firefox's native iframe focus styling.
Closes tailwindlabs#19795
Co-authored-by: Kirk Loretz <kirk-loretz-fsn@users.noreply.github.com>
0250685 to
005b8bd
Compare
| */ | ||
|
|
||
| :-moz-focusring { | ||
| :-moz-focusring:where(:not(iframe)) { |
There was a problem hiding this comment.
Snapshot Still Stale The generated Preflight output now contains
:-moz-focusring:where(:not(iframe)), but the CLI integration inline snapshot still expects :-moz-focusring {. When that CLI test compares the generated CSS against the inline snapshot, it can still fail with a snapshot mismatch. Please update the remaining inline snapshot along with the checked-in snapshot files.
| */ | ||
|
|
||
| :-moz-focusring { | ||
| :-moz-focusring:where(:not(iframe)) { |
There was a problem hiding this comment.
The generated Preflight selector changed here, but the CLI integration inline snapshot still expects :-moz-focusring { for the @import 'tailwindcss' output. When that test compares the generated CSS, it will receive :-moz-focusring:where(:not(iframe)) { and fail the snapshot match. Please update the remaining CLI inline snapshot with this selector change.
RobinMalfait
left a comment
There was a problem hiding this comment.
Thanks! Just make sure that next time you run the tests 💪
Description
Firefox's UA stylesheet already sets
iframe:focus-visible { outline-style: none; }, so Preflight's:-moz-focusring { outline: auto; }rule overrides that and applies an unwanted auto outline to focused iframes.Adding
:where(:not(iframe))to the selector preserves the improved focus ring behavior for all other elements while respecting Firefox's native iframe focus styling.Fixes #19795
Edit by @RobinMalfait
Test plan
Before:

After:
