-
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
Components: improve vertical
and RTL support for Divider
#36579
Conversation
vertical
and RTL support for Divider
vertical
and RTL support for Divider
Size Change: +97 B (0%) Total Size: 1.1 MB
ℹ️ View Unchanged
|
Thanks so much for the improvement. I'll defer to other reviewers for the more technical bits, but as a tool in our toolbox this one seems stronger now. Whether we find a need for the component I'm not yet sure — I think we will as part of a block toolbar refactor. One question about this part:
I'm always anxious about hardcoded colors, even if they can be updated everywhere by editing a single component. But beyond the hard coded color (which could become a variable), I'm also starting to think about what we'll have to do when we can start bringing dark mode to the editor, how will that be handled? One potentially hacky solution could be to replace the color value with |
That override of the border color is there specifically for the Storybook example to make the With regards to theming and dark mode, there are many ways to tackle this problem, using a mix of CSS APIs (like CSS variables and the |
I think so, but I also think its default color should be currentColor and not a semitransparent black. Those defaults in general feel worth looking at (separately), as none of them feel very compatible with the design language of the block editor (for which there are some decent examples in #34574). To an extent, those defaults should look a bit more like those defined in our base styles: colors, other metrics.
👌 |
Thanks for the feedback, @jasmussen ! I've updated this PR and followed your advice:
|
b83639e
to
a7f1bcb
Compare
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.
Really nice improvements, logical props ftw 💥
Maybe not in scope for this PR, but I noticed that this component doesn't include a CSS reset for the default borders on the hr
element. It's intended to be just a 1px separator, correct?
a4b1793
to
5502a35
Compare
Hey @mirka , your initial feedback should have all been addressed! I also rebased on top of |
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.
Solid improvements 🚢
5502a35
to
0722821
Compare
Will merge once the PHP unit tests won't fail 😅 (unrelated to this PR) |
…/end margin props
0722821
to
b160690
Compare
Description
Following up some feedback from #36302, This PR brings a bunch of improvements to the
Divider
components:vertical
orientationmarginTop
andmarginBottom
props withmarginStart
andmarginEnd
(which are a better abstraction regardless of the orientation). Added RTL support in the processborder-color
override to black from Storybook, and changed the defaultDivider
'sborder-color
to becurrentColor
How has this been tested?
Unit tests pass, storybook works as expected
Types of changes
New feature (vertical styles), Refactor (margin top/bottom => start/end)
Checklist:
*.native.js
files for terms that need renaming or removal).