Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#55276 closed defect (bug) (worksforme)

:where is easily being overridden

Reported by: vijayhardaha's profile vijayhardaha Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.9.1
Component: Editor Keywords:
Focuses: css Cc:

Description

Found an issue in the forum https://wordpress.org/support/topic/button-issue-with-theme-twenty-twenty-and-version-5-9-1/

when I investigated the issue, I noticed the change that

.is-style-outline>.wp-block-button__link,.wp-block-button__link.is-style-outline {
    border: 2px solid;
    padding: .667em 1.333em
}

is changed to

.is-style-outline>:where(.wp-block-button__link),:where(.wp-block-button__link).is-style-outline {
    border: 2px solid;
    padding: .667em 1.333em
}

:where is being used in the new version. But from this change it's priority is lower than .wp-block-button__link normal single class .wp-block-button__link is easily overriding that block editor CSS that have :where now.

Change History (3)

#1 @glendaviesnz
3 years ago

Hi @vijayhardaha, thanks for taking the time to report this.

This was an intentional change, made here https://github.com/WordPress/gutenberg/pull/35968, in order to ensure that any CSS settings for buttons in a theme take priority over the default core settings, as a theme should be able to easily override these defaults.

In the case where the theme settings are not the desired ones, then this can be overridden by adding custom CSS as you suggested in the forum ticket, or in the case of a block-based theme, it can be overridden by setting the border at the individual block level, or at a site level using global styles in the site editor.

@oandregal, did you have anything to add to this?

#2 @vijayhardaha
3 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

#3 @desrosj
2 years ago

  • Component changed from General to Editor
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.