Repository navigation
fix: scope the forms reset so it stops restyling every checkbox on the page - #366
Merged
arifulhoque7 merged 1 commit intoSep 24, 2026
Conversation
…e page
@tailwindcss/forms writes its reset as bare element rules
(input:where([type='checkbox']) { appearance: none; ... }). The
`important` scope and tailwindcss-scoped-preflight do not reach plugin
base rules, so wherever the admin bundle or the Breadcrumb, Sidebar,
DocNavigation and QuickSearch block stylesheets loaded, every checkbox,
radio, select and text field on the page was restyled, the theme's and
other plugins' included.
tailwind.scoped-forms.js runs the forms plugin unchanged and appends
:where(.wedocs-document, .wedocs-document *) to each selector it adds,
the same form the scoped preflight uses. :where() adds no specificity,
so weDocs' own fields keep the weight they had.
Measured on WordPress 7.1.2 with Hello Elementor: the same 28 forms
rules per file are now scoped and nothing else in the CSS changes (rule
counts identical); a checkbox outside weDocs on a single doc or a page
with a QuickSearch block stays native (13x13, appearance auto) instead of
16x16 blue; 19 screenshots of weDocs' own UI (docs, blocks, QuickSearch
modal, admin screens, settings tabs) are pixel-identical before and
after, bar anti-aliasing noise (5 px at 3/255) on one.
Claude-Session: https://claude.ai/code/session_01NYhesBBDCSe89DpyPiynVN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Reported: "Stylesheets from your plugin is loaded everywhere on the site. Slows down the site and break all checkboxes on my all websites." Details and measurements: weDevsOfficial/wedocs-pro#433.
@tailwindcss/formswrites its reset as bare element rules (input:where([type='checkbox']) { appearance: none; ... }). Neither theimportantscope nortailwindcss-scoped-preflightreaches plugin base rules, so on any page where one of these stylesheets loads, every checkbox, radio, select and text field on the page is restyled, not just the ones in weDocs markup. #364 already stops the block stylesheets loading site-wide; this fixes what they do on the pages that still load them.Fix
tailwind.scoped-forms.jsruns the forms plugin unchanged and appends the container scope to every selector it adds, the same:where(<container>, <container> *)form the scoped preflight already uses.:where()adds no specificity, so weDocs' own fields keep the weight they had.Wired into the admin bundle (
src/assets/css/index.css) and the four Tailwind block stylesheets (Breadcrumb, Sidebar, DocNavigation, QuickSearch), scoped to.wedocs-document. The new file is listed in.distignore; the zip uses an allowlist and never included root tooling files.Evidence (WordPress 7.1.2, Hello Elementor, both release builds installed from zip)
appearance:none, 16x16, blue fill to native 13x13. In wp-admin the remaining 16px styling is core's own (identical with weDocs' sheets disabled).Part of weDevsOfficial/wedocs-pro#433 (Pro companion PR fixes
frontend.css). Independent of the Pro PR, no merge order.https://claude.ai/code/session_01NYhesBBDCSe89DpyPiynVN