Skip to content

New enforced border style in WordPress 7.0 #78802

Description

@markhowellsmead

Description

There is a new CSS rule in 7.0 - html :where([style*=border-color]) - which enforces border-style: solid;. Where a border-style and border-color are defined on an element with no explicit border-width, browsers interpret this and enforce a default border width on elements which have no border-width explicitly defined. This means that after updating, some elements now have a visible border in the default state where they didn't in WordPress 6.9. This breaks layout and visual styling.

Step-by-step reproduction instructions

  1. Add a border colour to an element but do not define a border style or border width.

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions