-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
react-combobox: style fixes from design review #23440
Conversation
packages/react-components/react-combobox/src/components/ComboButton/ComboButton.types.ts
Outdated
Show resolved
Hide resolved
📊 Bundle size report
🤖 This report was generated against 52f6f9da2687560b5f165309c6c54c63878379f8 |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f499836:
|
can we get a before/after screenshot to see what changed? |
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 52f6f9da2687560b5f165309c6c54c63878379f8 (build) |
@@ -64,6 +64,7 @@ const useStyles = makeStyles({ | |||
columnGap: tokens.spacingHorizontalXXS, | |||
display: 'flex', | |||
flexWrap: 'nowrap', | |||
fontFamily: tokens.fontFamilyBase, |
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.
Maybe use the typographyStyles
exports from react-theme instead? That ensures that all of the appropriate font props are set. (Even with this change, it's still using the inherited font-weight 🙀)
E.g. instead of setting fontFamily
here, the small
class would be:
small: {
...typographyStyles.caption1,
...shorthands.padding(/*...*/),
},
etc. for the other sizes.
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.
interestingly, the design spec actually doesn't call for any given font-weight 😅. They are all regular weight in practice though.
I can't fully use typographyStyles
since there isn't a style for regular-weight 400 size text. Given that, I'm kind of inclined to just put the font weight and font family on the base style block, and only alter font-size/line-height for sizes.
Does that make sense to you? That feels less weird to me than having a mixed approach :P
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.
It might be worthwhile double checking the font sizes with design. The design spec should probably be referencing the font aliases like "Subtitle 2" instead of just font sizes. In fact, it might be a bug in the design that it's asking for a 400-size font with regular weight, so this might help clear that up.
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 chatted w/ design, they're checking on whether to add another font alias for this
packages/react-components/react-combobox/src/components/OptionGroup/useOptionGroupStyles.ts
Outdated
Show resolved
Hide resolved
packages/react-components/react-combobox/src/components/Option/Option.types.ts
Outdated
Show resolved
Hide resolved
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.
Thanks for making the updates! It looks like you need to re-generate the .api.md and test snapshot.
packages/react-components/react-combobox/src/components/Option/useOptionStyles.ts
Outdated
Show resolved
Hide resolved
packages/react-components/react-combobox/src/components/Option/useOptionStyles.ts
Outdated
Show resolved
Hide resolved
1e6cb5e
to
25018b7
Compare
1801525
to
11f2753
Compare
packages/react-components/react-combobox/src/stories/ComboboxCustomOptions.stories.tsx
Show resolved
Hide resolved
packages/react-components/react-combobox/src/stories/ComboboxDefault.stories.tsx
Show resolved
Hide resolved
packages/react-components/react-combobox/src/stories/ComboboxGrouped.stories.tsx
Show resolved
Hide resolved
packages/react-components/react-combobox/src/stories/ComboboxMultiselect.stories.tsx
Show resolved
Hide resolved
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.
Remove flex gap usable, replace with margin/padding etc
@@ -74,6 +75,8 @@ const useStyles = makeStyles({ | |||
|
|||
checkIcon: { | |||
fontSize: tokens.fontSizeBase400, | |||
marginLeft: `calc(${tokens.spacingHorizontalXXS} * -1)`, |
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.
Consider a comment explaining why the icon needs a negative left margin.
4008969
to
f499836
Compare
The following came up in a design review, fixed by this PR:
cursor: pointer
on optionsBefore:
After: