Repository navigation
Pullquote: Inherit custom line height in the editor - #80585
Closed
jorgefilipecosta wants to merge 1 commit into
Closed
jorgefilipecosta wants to merge 1 commit into
jorgefilipecosta wants to merge 1 commit into
Conversation
Member
Author
|
Superseded by #80586, which uses a branch in the WordPress/gutenberg repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Closes #49261.
Ensures that the Pullquote block's paragraph inherits an explicitly selected line height from the block wrapper in the editor.
Why?
In a classic theme without
theme.json, or when Use theme styles is disabled, Gutenberg loads its default editor styles. Those styles applyline-height: 1.8directly to everypelement.The Pullquote typography support applies the selected line height to the outer
figure.wp-block-pullquote. Because its inner paragraph already has a directly applied line height, it does not inherit the value selected for the block. This makes the editor differ from the saved content.How?
Adds an editor-only rule for Pullquote blocks with an inline
line-heightdeclaration:The conditional selector avoids changing Pullquotes without a custom line height. Keeping the rule in
editor.scssmeans it does not change saved markup or front-end styles, and:where(p)keeps the child selector's specificity low.Testing Instructions
Build and start Gutenberg:
Create and activate a minimal classic theme without a
theme.jsonfile.style.css:functions.php:index.php:Ensure the Gutenberg plugin is active.
Open the post editor and disable Use theme styles under Options → Preferences → Appearance.
Switch to the code editor and paste:
Return to the visual editor.
Confirm that the spacing between the Pullquote paragraph lines reflects the selected line height of
4.In browser developer tools, confirm that both the outer Pullquote and its paragraph have the same computed line height. With the markup above, both should compute to
96px.On
trunk, the wrapper computes to96px, while the paragraph remains at43.2pxbecause of the default1.8paragraph line height.Testing Instructions for Keyboard
This change only affects CSS inheritance and does not introduce or change any interactive behavior.
Screenshots or screencast
The screenshots were captured in an isolated
wp-envon port8892using the classic test theme and the production-built default editor and Pullquote styles. The displayed values are the browser's computed line heights.Checks performed
npm run buildnpm run format -- packages/block-library/src/pullquote/editor.scssnpm run lint:css -- packages/block-library/src/pullquote/editor.scsswp-env: wrapper96px, paragraph96pxUse of AI Tools
OpenAI Codex was used to investigate the issue, implement the CSS change, run the automated and visual checks, capture the screenshots, and draft this pull request description.