Fix sr-only table caption visibility in Firefox (#20510) - #20521
abdelrhmanahmed255 wants to merge 5 commits into
Conversation
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. WalkthroughThe preflight stylesheet applies Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk is identified in the supplied change context; the change appears ready to merge after normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/tailwindcss/src/utilities.test.ts (1)
27-30: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover the preflight caption selector.
run(['sr-only'])uses@tailwind utilitiesby default. The added tests cannot exercisepreflight.css. They assert only utility declarations. Add a preflight compilation test that checks the caption selector,clip-path: inherit, andoverflow: hidden.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: bccfd727-c75c-4794-8f86-c16e5157408e
📒 Files selected for processing (3)
CHANGELOG.mdpackages/tailwindcss/preflight.csspackages/tailwindcss/src/utilities.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
| caption { | ||
| clip-path: inherit; | ||
| } |
There was a problem hiding this comment.
Wrapped table captions remain visible
For <div class="sr-only"><table><caption>…</caption></table></div>, the caption now inherits clip-path from the table, not the hidden wrapper. The table does not inherit the wrapper’s clip-path, so the caption receives none. Removing the selector that covered this pattern lets the caption remain visible in Firefox.
| caption { | ||
| clip-path: inherit; | ||
| } |
There was a problem hiding this comment.
Problem
Applying
.sr-onlyto a<table>does not visually hide its child<caption>elements in Firefox.Because Firefox handles table captions as separate formatting roots outside the main table grid box, the parent table's
overflow: hiddenandclip-path: inset(50%)do not clip the caption content.Solution
Added a rule in
preflight.cssensuring captions in visually hidden tables inherit clipping: