-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
p
tag to inherit whateverfont-size
andline-height
are set on thebody
i.e.,.editor-styles-wrapper
.Currently the
p
tag here overrides a theme's most basic of font styles unlessfont-size
andline-height
are set onp
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.
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: