Make WordPress Core

Opened 5 years ago

Closed 2 years ago

#55281 closed enhancement (wontfix)

Twenty Twenty-One: Consider decreasing the selector specificity

Reported by: orkunaybek Owned by:
Priority: normal Milestone:
Component: Bundled Theme Version: 5.6
Severity: normal Keywords: has-screenshots close
Cc: Focuses: css

Description (last modified by sabernhardt)

There is a CSS selector that selects almost any a tags and applies white background on focus. This forces users to use at least 4 classes on elements to override by specificity and complicate the code. You can see mentioned selector and how it overrides the focus color of a button with 3 classes already in attached screenshots. Why such strong selector is used there, is it really necessary, can we remove it or decrease the specificity?

Attachments (2)

selector.png​ (266.1 KB ) - added by orkunaybek 5 years ago.
effect.png​ (645.0 KB ) - added by orkunaybek 5 years ago.

Download all attachments as: .zip

Change History (5)

#1 @sabernhardt
4 years ago

  • Description modified (diff)
  • Summary Twenty Twenty One Theme: Consider decreasing the selector specificity → Twenty Twenty-One: Consider decreasing the selector specificity
  • Version 5.9.1 → 5.6

Hi and welcome to Trac!

It's technically a set of selectors in 04-elements/links.scss, and each starts with:

.site a:focus:not(.wp-block-button__link):not(.wp-block-file__button)

#2 @karmatosed
2 years ago

  • Keywords close added; needs-patch removed

I am going to recommend this is closed. Firstly, whilst time should not be the only reason we close something, it has been there for a while, and to change specificity now might impact in ways causing issues.

If a solution that is desirable and doesn't do this can be found, I am happy to consider it, though. Thanks, everyone.

#3 @karmatosed
2 years ago

  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status new → closed

Thank you everyone I am going to now progress this to close.

Note: See TracTickets for help on using tickets.