-
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
Post editor: Fix the style settings from core/post-content block in theme.json that are not applied in the editor. #42270
Conversation
… for elements inside core/post-content in the editor. Without this class the styles are not applied.
Size Change: +11 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
I can confirm that this fixes the issue. Looks like the right place to add this necessary class. Re-running the tests as the failures don't look to be related to the change. |
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.
Checks passing now, this LGTM
This change can make this TT3 change look good in the editor so I'm merging it. |
@matiasbenedetto I'm seeing a regression as a result of this PR. Specifically that the top margin for block gap is missing now: Which results in this: Here's what it should look like: I'm seeing this only in TT3, not TT2 or other themes. I was initially running a recent but not totally up to date version of TT3, but even pulling the latest has not fixed this for me. Is there a pending TT3 change to go with this, or do you have any insights what might be causing the start margin to not be output? |
Hi @jasmussen thanks for your ping! The change introduced in this PR doesn't seem to be the cause of the problem you are pointing out. As visible in this screenshot, the same problem can be reproduced in the frontend where the class added by this PR was already present before this PR. Apart from that, adding a class to an element should not be a reason to render invalid CSS as is happening now. The root cause seems to be a problem related to the rendering of the default block gap styles. I may have a fix for that I will submit shortly. |
Thank you for following up! I can't be entirely certain when the issue happened, but the way I found this PR was to go to to the commits list and check out the full SHA for various commits until I found an old enough commit that didn't have the problem. Specifically, the commit before this branch was did not have this issue: If you can reproduce in the editor, you can test using |
Yep, I see what are you saying but this problem you are pointing out is just a symptom of a deeper problem not related to the use of the class added in this PR. I described the problem more extensively here: #43924 and submitted a potential fix for that: #43925 |
Ah thank you for the context 🙏 |
What?
Fix the style settings for core/post-content block from
theme.json
that are not applied in the editor.Issue: #42267
Why?
If you add style settings to theme.json using the elements API inside a core/post-content block the resulting styles are not applied in the editor.
How?
Adding a class to apply the styles defined in theme.json for elements inside core/post-content in the editor.
Testing Instructions
emptytheme
to discard theme style conflicts.theme.json
file add these settings:Screenshots or screencast
Before:
After: