-
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
Fix overflow in patterns filter container #65987
base: trunk
Are you sure you want to change the base?
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +18 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
margin-top: $grid-unit-10; | ||
margin-left: -$grid-unit-10; | ||
margin-right: -$grid-unit-10; | ||
margin-bottom: -$grid-unit-10; |
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.
I'd like to understand a little more about why these margins were needed and why it's now ok to remove them without consequences 🙏
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, styles are separated, I am going to revert them back to original state.
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 fixes the scrollbar issue on the patterns filter menu for me 👍
trunk | This PR |
---|---|
It increases the spacing in case of tools menu, but they are now aligned with the icons. May be reduce the container padding here?
Perhaps we could add some specific padding to .components-dropdown__content .components-popover__content .block-editor-tool-selector__help
, e.g. in these dropdown styles, we could add the following to reduce the padding around this text:
.components-dropdown__content {
.components-popover__content {
.block-editor-tool-selector__help {
padding: $grid-unit-20 $grid-unit-10;
}
...
Edit: We should avoid using the .block-editor-tool-selector__help
class here - see this comment below - but I still think this might be a way forward (using a different selector) to avoid this style regression.
Pinging @jasmussen on this too, as it looks like you were working on this CSS back in #34435.
Just noting that I don't think components styles are allowed to be coupled to the block editor classes. The components package should be decouple from all "instances" where it might be used. |
Ah yes, that makes sense. In that case, if we did want to add some specific styles here, we'd need to target them in a different way to avoid using the block editor class. |
Nice to see just red code in this PR. To answer Dave's good question, those local CSS overrides piled up from a delicate balancing act chronicled in #34435 and #34378 (comment), and are ultimately a reflection of the lack of maturity of the components at the time. Best practice is to never have local CSS overrides, so the more we can remove, the better. |
Makes sense. Disconnected the components by creating own class for patterns filter in aea7072. Regarding the text itself, I think it deserves its own component such as |
What?
This fixes overflow in patterns filter by removing the negative margins.
@richtabor It increases the spacing in case of tools menu, but they are now aligned with the icons. May be reduce the container padding here?
Testing Instructions
+
-> Patterns -> Filter and verify it has no scrollbars