Make editor p tag "go with the flow".#12998
Conversation
This commit sets the `p` tag to inherit whatever `font-size` and `line-height` are set on the `body` i.e., `.editor-styles-wrapper`. Currently the `p` tag here overrides a theme's most basic of font styles unless `font-size` and `line-height` are set on `p` in that theme. And from what I've seen, being that specific on `p` is an uncommon pattern. This also makes it easier and requires less specificity to style paragraphs on a per block basis by simply adding the font-size to the block container.
|
This should partly fix #11200, I think? |
|
Yep, I actually tried to find that ticket @chrisvanpatten but couldn't remember what it was exactly. Looking at it now, this wouldn't directly fix that issue. The Unless a |
|
Worth checking with themes not providing editor styles to see if it's correct. I remember that this was originally needed because Core used to styles for the paragraphs by default but maybe this inherit technique fix the issue. |
kjellr
left a comment
There was a problem hiding this comment.
This seems solid, and should allow themes to be a little less specific in their style declarations. 👍
I tested with a number of themes: some that provided editor styles, and some that didn't. All seemed to work just fine.
This commit sets the `p` tag to inherit whatever `font-size` and `line-height` are set on the `body` i.e., `.editor-styles-wrapper`. Currently the `p` tag here overrides a theme's most basic of font styles unless `font-size` and `line-height` are set on `p` in that theme. And from what I've seen, being that specific on `p` is an uncommon pattern. This also makes it easier and requires less specificity to style paragraphs on a per block basis by simply adding the font-size to the block container.
This commit sets the `p` tag to inherit whatever `font-size` and `line-height` are set on the `body` i.e., `.editor-styles-wrapper`. Currently the `p` tag here overrides a theme's most basic of font styles unless `font-size` and `line-height` are set on `p` in that theme. And from what I've seen, being that specific on `p` is an uncommon pattern. This also makes it easier and requires less specificity to style paragraphs on a per block basis by simply adding the font-size to the block container.
Description
This commit sets the
ptag to inherit whateverfont-sizeandline-heightare set on thebodyi.e.,.editor-styles-wrapper.Currently the
ptag here overrides a theme's most basic of font styles unlessfont-sizeandline-heightare set onpin that theme.And from what I've seen, being that specific on
pis an uncommon pattern.This also makes it easier and requires less specificity to style paragraphs on a per block basis by simply adding the font-size to the block container.
How has this been tested?
I see no visual changes on a fresh underscores theme with demo content.
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: