#55276 closed defect (bug) (worksforme)
:where is easily being overridden
Reported by: | 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)
Note: See
TracTickets for help on using
tickets.
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?