gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Adding a drop-cap to a paragraph changes line-height

Open sarahmonster opened this issue 8 years ago • 2 comments

A standard paragraph uses a line-height of 1.8. When adding a drop-cap to the paragraph, the line-height drops to 1.5. Disabling the drop-cap doesn't adjust the line-height back to its original value.

2018-09-12 23 31 59

Looks as though a CSS class is being dropped when the drop-cap is enabled.

Before drop-cap: wp-block-paragraph editor-rich-text__tinymce mce-content-body During drop-cap: wp-block-paragraph has-drop-cap editor-rich-text__tinymce After drop-cap: wp-block-paragraph editor-rich-text__tinymce

Removing mce-content-body means that the .editor-rich-text__tinymce.mce-content-body CSS rule about line-height aren't respected, and the line-height falls back to the default for <p> elements.

sarahmonster avatar Sep 12 '18 22:09 sarahmonster

Nice find. Any edit from the Block Settings (font size, background color, text color), not just the dropcap, will remove the mce-content-body class, which will lower the line-height to the default of 1.5. The class gets added again only after you refresh the page.

cristian-raiber avatar Sep 14 '18 11:09 cristian-raiber

I cannot reproduce this anymore.

mtias avatar Nov 16 '18 19:11 mtias