[wp-trac] [WordPress Trac] #50271: Twenty Twenty uses overly specific selector for button background
WordPress Trac
noreply at wordpress.org
Wed May 27 23:36:35 UTC 2020
#50271: Twenty Twenty uses overly specific selector for button background
---------------------------+-----------------------------
Reporter: flixos90 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version:
Severity: normal | Keywords: needs-patch
Focuses: css |
---------------------------+-----------------------------
Twenty Twenty uses a `button:not(.toggle)` selector to set the Customizer-
chosen background-color for buttons in general. This can cause problems
with plugins that include their own buttons in the frontend and have
specific classes for them (e.g. cookie banner plugins), because the
`:not(.toggle)` part makes the selector too specific, overriding any
class-selectors applying to buttons, even if provided as
`button.{className}`.
Since Twenty Twenty already includes a `button.toggle` rule that sets
`background: none`, there really is no need for the `button:not(.toggle)`
selector usage anyway. Since it introduces the above specificity problems,
it would be better to simplify this selector to just `button`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50271>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list