-
Notifications
You must be signed in to change notification settings - Fork 4.7k
BorderControl: Render border color/style dropdown as UnitControl prefix #42212
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
Conversation
andrewserong
left a comment
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.
Nice cleanup PR @aaronrobertshaw! This is testing well for me in Storybook and the different widths (compact and custom width), and the component still looks and functions the same in the editor via a Group block and the border controls.
LGTM! ✨
mirka
left a comment
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'm very happy to see things getting simplified 🎉
| /* Prevent unit select forcing min height larger than its UnitControl */ | ||
| min-height: 0; | ||
| ${ rtl( | ||
| { | ||
| borderRadius: '0 1px 1px 0', | ||
| marginRight: 0, | ||
| }, | ||
| { | ||
| borderRadius: '1px 0 0 1px', | ||
| marginLeft: 0, | ||
| } | ||
| { borderRadius: '0 2px 2px 0' }, | ||
| { borderRadius: '2px 0 0 2px' } |
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'm not sure I understand what these styles are for 🤔 Are they no longer needed...?
The :focus stuff too, should they be moved to UnitControl itself? (Not necessarily in this PR)
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 swear that when I was putting this PR together I still needed these styles or the unit select showed square corners. I must have been seeing things. After retesting the border-radius rules can be removed.
While testing the focus styles it looks like the focus styling in general for the UnitControl is a little broken e.g. wrapper's border overlays the unit selects focus border/box-shadow etc.
I've moved these focus styles to the UnitControl in a separate PR in the hope that might provide a better historical record if we need to revisit them in the future. See #42383.
For this PR, I'll update it shortly to target the #42383 branch as its base and simply remove the overrides from the BorderControl.
41dce38 to
ffc8d0d
Compare
|
Nice PR, too bad it was ignored by the 6.0.1 update from earlier today. |
ciampo
left a comment
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.
Great work!
2cfb9f2 to
4a6a3e6
Compare
ffc8d0d to
9974f64
Compare
9974f64 to
498d1df
Compare
What?
Renders the
BorderControldropdown as aprefixwithin itsUnitControl.Why?
Rendering as a prefix on the UnitControl allows us to reduce some of the CSS overrides.
How?
UnitControlPropstype to allow aReactNodefor theprefixprop.UnitControl'sprefix.HStackwrapper and cleans up/fixes stylesTesting Instructions
npm run build:package-typesBorderControlunit tests still pass:npm run test-unit packages/components/src/border-control/testBorderBoxControlunit tests pass:npm run test-unit packages/components/src/border-box-control/testBorderControl&BorderBoxControlisCompactandwidthprops.