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

Preformatted block: add line-height control option #34127

Closed
sabernhardt opened this issue Aug 17, 2021 · 4 comments
Closed

Preformatted block: add line-height control option #34127

sabernhardt opened this issue Aug 17, 2021 · 4 comments
Labels
[Block] Preformatted Affects the Preformatted Block - used for showing preformatted text Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@sabernhardt
Copy link
Contributor

What problem does this address?

As @noisysocks noted on Trac ticket 48402:
With default pre element styles in the (Twenty Twenty) theme, "the line height in a Preformatted block is so large that it renders the block impractical for things such as ASCII art and diagrams."

Any theme can specify a large line-height, so having an option to reduce that on preformatted blocks would help. Then any adjustments for ASCII art do not affect other pre blocks that benefit from a larger line-height, such as Verse and Code.

Screenshot from the Trac ticket:
preformatted diagram with gaps between characters

What is your proposed solution?

The Preformatted block could have the same line-height control currently available for Paragraph blocks (when opted in).

@swissspidy swissspidy added [Block] Preformatted Affects the Preformatted Block - used for showing preformatted text [Type] Enhancement A suggestion for improvement. labels Aug 18, 2021
@noisysocks
Copy link
Member

@nosolosw: Is line-height something that can be adjusted in global styles?

@oandregal
Copy link
Member

Yup, absolutely. Any block can declare support for it and then themes can target that style.

@noisysocks
Copy link
Member

Awesome. Sounds like we just need to set supports.lineHeight to true in the Preformatted block, then.

This value signals that a block supports the line-height CSS style property. When it does, the block editor will show an UI control for the user to set its value if the theme declares support.

@noisysocks noisysocks added the Needs Dev Ready for, and needs developer efforts label Aug 20, 2021
@Mamaduka
Copy link
Member

Mamaduka commented Jan 6, 2022

Fixed via #34064.

@Mamaduka Mamaduka closed this as completed Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Preformatted Affects the Preformatted Block - used for showing preformatted text Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

5 participants