-
Notifications
You must be signed in to change notification settings - Fork 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
FSE: Update FSE editor css to remove template-block space #35070
Conversation
} | ||
|
||
.template-block { | ||
margin-top: -28px; |
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.
Since we can't target parent selectors accurately, the only way I can see to remove the editor UI spacing is to use a negative margin here. The 28px space is there for editor block insertion UI (the (+) button before blocks) which is never present for these template blocks.
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.
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.
Ah yes, I think we can actually remove this negative margin hack by adding top level css classes like here: https://github.com/Automattic/wp-calypso/pull/35081/files#diff-d4f340da4f72898d36eb7f2ca6c1e127R31
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.
Wild idea, why not applying the negative margin too to the wrapper?
.editor-styles-wrapper {
margin-top: -28px;
padding: 0;
}
(AFAICS the wrapper doesn't really need margin: 0
, but maybe I'm not testing some cases 🤔 )
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
margin: 0; | ||
} | ||
|
||
.template-block { |
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.
The following will target just the header template block:
.template-block { | |
.editor-block-list__block:first-child { | |
.template-block { | |
margin-top: -28px; | |
} | |
} |
But seems a bit fragile - I wonder it we need to try and get some custom classes in the header and footer blocks in order to more reliably target these?
I wonder if it would be more straightforward to get the outer "frame" color working? #34684 It filled in the whitespace in a nice way and it seems like we wouldn't have to do a ton to get it working! |
This one is on hold until #35115 is merged, since it will use the new top level class names for our template blocks. |
This helps, but there is still extra space even with that frame. You can try #35116 to see this. |
Going to close this one and refactor and open a new PR. |
Changes proposed in this Pull Request
This removes the spacing above template part blocks.
Before:
After:
Testing instructions
Fixes: #34890