Skip to content

a:not(.wp-element-button) CSS rule conflicts with theme styles #42616

@ZebulanStanphill

Description

@ZebulanStanphill

Description

Gutenberg is currently outputting the following style rule for themes with a theme.json file:

a:not(.wp-element-button) {
	text-decoration: underline;
}

Prior to #42072 (which landed in Gutenberg 13.7.0), this rule only used a simple a selector. But now that it has higher specificity, I've found it overriding various styles in the theme I'm using (namely, a child theme of Divi... the issue would also happen with base Divi if it had a theme.json).

What is the purpose of this style to begin with? Links already use underlines by default in every browser that I know of. The rule seems redundant.

Step-by-step reproduction instructions

  1. Use a theme with a theme.json.
  2. Place a link somewhere in a post and save.
  3. Open the post.
  4. Use your browser's Inspect Element tool to view all the styles being applied to the link.
  5. Notice the a:not(.wp-element-button) styles.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.0.1
  • Gutenberg 13.7.1

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    CSS StylingRelated to editor and front end styles, CSS-specific issues.[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Type] RegressionRelated to a regression in the latest release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions