Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separator Block: Border styles set in theme.json are overwritten by the Gutenberg plugin #60634

Closed
dashkevych opened this issue Apr 10, 2024 · 2 comments · Fixed by #60740
Closed
Assignees
Labels
[Block] Separator Affects the Separator Block [Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release

Comments

@dashkevych
Copy link

Description

Updating the Gutenberg plugin to v18.1.0 causing border styles inconsistency for a default block style.
It seems like the plugin overrides styles set in theme.json:

"core/separator": {
	"border": {
		"color": "currentColor",
		"style": "solid",
		"width": "4px 0 0"
	}
},

When the Gutenberg plugin is deactivated the styles look correct with the following CSS output:

.wp-block-separator {
    border-color: currentColor;
    border-width: 4px 0 0;
    border-style: solid;
}

When the Gutenberg plugin is active, the styles are overwritten by the plugin, with the following CSS output:

.wp-block-separator {
    border: none;
    border-top: 2px solid;
}
:where(.wp-block-separator) {
    border-color: currentColor;
    border-width: 4px 0 0;
    border-style: solid;
}

Step-by-step reproduction instructions

  1. Edit border styles for the Separator Block in theme.json.
  2. Add the Separator Block with default style to the post/page.
  3. Publish/Update and then preview the post/page.

Screenshots, screen recording, code snippet

Active Gutenberg plugin:

Issue with border styles when plugin is active

Inactive Gutenberg plugin:

Correct border styles when plugin is inactive

Environment info

  • WordPress: 6.5.2
  • Gutenberg: 18.1.0

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

@dashkevych dashkevych added the [Type] Bug An existing feature does not function as intended label Apr 10, 2024
@skorasaurus skorasaurus added [Type] Regression Related to a regression in the latest release [Block] Separator Affects the Separator Block and removed [Type] Bug An existing feature does not function as intended labels Apr 10, 2024
@andrewserong
Copy link
Contributor

@tellthemachines this looks like a similar issue to #60646, which we resolved in #60649. I might run out of time to get to this today, but it sounds like this block could use some specificity reduction for its default styles, too?

@tellthemachines
Copy link
Contributor

@andrewserong looks like it does! Might not be a bad idea to look at all core block stylesheets and lower specificity of any styles that can override their block supports. There's probably a few more lying around 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Separator Affects the Separator Block [Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release
Projects
None yet
4 participants