-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Differing CSS specificity between Non-Iframed Editor and Front end #63925
Copy link
Copy link
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
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
Type
Fields
Give feedbackNo fields configured for issues without a type.
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-wrapperprefix.Step-by-step reproduction instructions
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.csstemplates/index.html<!-- wp:post-content /-->Observed behavior
✅
core/headingblock styles override top-level elementheadingstyles.✅
core/headingblock styles override top-level elementheadingstyles.❌ Top-level element
headingstyles overridecore/headingblock styles. Elementheadingstyles have specificity (0, 1, 1) whereascore/headingblock styles have (0, 1, 0).Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.