Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#50271 closed defect (bug) (fixed)

Twenty Twenty uses overly specific selector for button background

Reported by: flixos90's profile flixos90 Owned by: ianbelanger's profile ianbelanger
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch
Focuses: css Cc:

Description

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.

Attachments (1)

50271.diff (1.5 KB) - added by flixos90 5 years ago.

Download all attachments as: .zip

Change History (8)

@flixos90
5 years ago

#1 @flixos90
5 years ago

  • Keywords has-patch added; needs-patch removed

50271.diff resolves the issue by changing button:not(.toggle) to button.

#2 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 5.5

#3 @ianbelanger
5 years ago

  • Keywords commit added
  • Owner set to ianbelanger
  • Status changed from new to reviewing

#4 @ianbelanger
5 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 47933:

Bundled Themes: Twenty Twenty uses overly specific selector for button background.

Fixes the issue by removing :not(.toogle) from the button selector, as it is not needed.

Props flixos90.
Fixes #50271.

#5 @ianbelanger
5 years ago

  • Keywords fixed-major added; commit removed
  • Milestone changed from 5.5 to 5.4.3
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backport.

#6 @desrosj
4 years ago

  • Keywords fixed-major removed
  • Milestone changed from 5.4.3 to 5.5

With 5.5 just under 5 weeks away, there is no 5.4.3 planned. Moving back to the 5.5 milestone.

#7 @desrosj
4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.