fix(ui): correct invalid disabled:file variant on the upload file-input#1056
Conversation
DocumentManagerPanel's <input type="file"> used `disabled:file:opacity-50`, which Tailwind compiles to a `:disabled` pseudo-class bound to the `::file-selector-button` pseudo-element. Only user-action pseudo-classes may follow a pseudo-element, so that selector is invalid CSS: Turbopack's dev parser rejects and drops the rule (the disabled file input was never actually dimmed, and the dev server logged a recurring globals.css parse error). Use plain `disabled:opacity-50`, which dims the whole control when disabled — the conventional, valid pattern. Verified with the project's own @tailwindcss/postcss transform: the old class emits 1 invalid `::file-selector-button`+`:disabled` selector, the fix emits 0. Pre-existing on main; the production build (lightningcss) tolerated it, so this is dev-parity plus a real cosmetic fix (disabled uploads now dim). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe guideline PDF file input now uses general disabled opacity styling instead of file-specific disabled opacity styling. ChangesDocument upload styling
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…-disabled-opacity
…-disabled-opacity
Summary
The document-upload
<input type="file">inDocumentManagerPanelused the classdisabled:file:opacity-50. Tailwind compiles that to a:disabledpseudo-class bound to the::file-selector-buttonpseudo-element. Per the CSS selectors spec only user-action pseudo-classes (:hover,:active, …) may follow a pseudo-element, so the generated selector is invalid CSS:globals.cssparse error (Invalid pseudo class after pseudo element), and a disabled file input was never actually dimmed.Fix: use plain
disabled:opacity-50on the input — the conventional, valid pattern that dims the whole control when disabled (the input is conditionallydisabledin demo mode / while uploading / without upload permission).Verification
Confirmed with the project's own
@tailwindcss/postcsstransform (toggling the class and re-compilingglobals.css):disabled:file:opacity-50→ 1 invalid selector emitted:.disabled\:file\:opacity-50:disabled::file-selector-buttondisabled:opacity-50→ 0 invalid selectorsPre-existing on
main; unrelated to any in-flight feature work. One-line, className-only change.Risk and rollout
🤖 Generated with Claude Code
Summary by CodeRabbit