-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended[Type] RegressionRelated to a regression in the latest releaseRelated to a regression in the latest release
Description
Description
With non-iframed block editor, specificity of top-level element selectors are different relative to other selectors. I believe this is due to the .editor-style-wrapper
prefix.
Step-by-step reproduction instructions
- Create theme using code snippets below.
- Activate the created theme.
- Edit a page or post.
- Add a Heading block, with default attributes and any text content.
- Save.
- Observe the font size.
- Top right 3-dots menu → Preferences → Enable "Custom Fields".
- Hit Show and Reload Page button (to enable the non-iframe editor).
- Observe the heading block size is different to step 5.
- On the front end, observe the heading block size is the same as 5.
Screenshots, screen recording, code snippet
Theme
theme.json
{
"$schema": "https://schemas.wp.org/wp/6.6/theme.json",
"version": 3,
"styles": {
"blocks": {
"core/heading": {
"typography": {
"fontSize": "var(--wp--preset--font-size--large)"
}
}
},
"elements": {
"heading": {
"typography": {
"fontSize": "inherit"
}
}
}
}
}
style.css
/*
Theme Name: Test
*/
templates/index.html
<!-- wp:post-content /-->
Observed behavior
Front end | Iframe editor | Non-iframe editor | |
---|---|---|---|
Screenshot | |||
CSS |
:root :where(.wp-block-heading) {
font-size: var(--wp--preset--font-size--large);
}
h1, h2, h3, h4, h5, h6 {
font-size: inherit;
} |
:root :where(.wp-block-heading) {
font-size: var(--wp--preset--font-size--large);
}
h1, h2, h3, h4, h5, h6 {
font-size: inherit;
} |
.editor-styles-wrapper h1,
.editor-styles-wrapper h2,
.editor-styles-wrapper h3
.editor-styles-wrapper h4,
.editor-styles-wrapper h5,
.editor-styles-wrapper h6 {
font-size: inherit;
}
.editor-styles-wrapper :where(.wp-block-heading) {
font-size: var(--wp--preset--font-size--large);
} |
Analysis |
✅ |
✅ |
❌ Top-level element |
Environment info
- WordPress 6.6.1
- Custom theme (see code snippets)
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
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended[Type] RegressionRelated to a regression in the latest releaseRelated to a regression in the latest release