-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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-select: update styles based on design review #24339
Changes from 3 commits
3df62a7
4ab2685
8863c0f
05648cc
33c2cf0
9a59600
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "fix: update styles based on design review", | ||
"packageName": "@fluentui/react-select", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,9 @@ const useSelectStyles = makeStyles({ | |
boxShadow: 'none', | ||
boxSizing: 'border-box', | ||
color: tokens.colorNeutralForeground1, | ||
cursor: 'pointer', | ||
flexGrow: 1, | ||
maxWidth: '100%', | ||
|
||
':focus': { | ||
outlineWidth: '2px', | ||
|
@@ -108,25 +110,59 @@ const useSelectStyles = makeStyles({ | |
...shorthands.borderColor('GrayText'), | ||
}, | ||
}, | ||
/* The right padding is calculated as the sum of the following: | ||
* 1. Field padding-right | ||
* 2. Icon width | ||
* 3. Content-icon spacing | ||
* 4. Content inner padding | ||
*/ | ||
small: { | ||
height: fieldHeights.small, | ||
...shorthands.padding('0', tokens.spacingHorizontalSNudge), | ||
paddingBottom: 0, | ||
paddingLeft: `calc(${tokens.spacingHorizontalSNudge} + ${tokens.spacingHorizontalXXS})`, | ||
paddingRight: `calc(${tokens.spacingHorizontalSNudge} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this feels like a LOT of calculations to get padding. is there some other way to create this space? is our layout approach not sufficient for this? Do we need to switch to grid or something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's b/c it's a |
||
+ ${iconSizes.small} | ||
+ ${tokens.spacingHorizontalXXS} | ||
+ ${tokens.spacingHorizontalXXS})`, | ||
paddingTop: 0, | ||
...typographyStyles.caption1, | ||
}, | ||
medium: { | ||
height: fieldHeights.medium, | ||
...shorthands.padding('0', tokens.spacingHorizontalMNudge), | ||
paddingBottom: 0, | ||
paddingLeft: `calc(${tokens.spacingHorizontalMNudge} + ${tokens.spacingHorizontalXXS})`, | ||
paddingRight: `calc(${tokens.spacingHorizontalMNudge} | ||
+ ${iconSizes.medium} | ||
+ ${tokens.spacingHorizontalXXS} | ||
+ ${tokens.spacingHorizontalXXS})`, | ||
paddingTop: 0, | ||
...typographyStyles.body1, | ||
}, | ||
large: { | ||
height: fieldHeights.large, | ||
...shorthands.padding('0', tokens.spacingHorizontalM), | ||
paddingBottom: 0, | ||
paddingLeft: `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`, | ||
paddingRight: `calc(${tokens.spacingHorizontalM} | ||
+ ${iconSizes.large} | ||
+ ${tokens.spacingHorizontalSNudge} | ||
+ ${tokens.spacingHorizontalSNudge})`, | ||
paddingTop: 0, | ||
...contentSizes[400], | ||
}, | ||
outline: { | ||
backgroundColor: tokens.colorNeutralBackground1, | ||
...shorthands.border('1px', 'solid', tokens.colorNeutralStroke1), | ||
borderBottomColor: tokens.colorNeutralStrokeAccessible, | ||
|
||
'&:hover': { | ||
...shorthands.borderColor(tokens.colorNeutralStroke1Hover), | ||
borderBottomColor: tokens.colorNeutralStrokeAccessible, | ||
}, | ||
|
||
'&:active': { | ||
...shorthands.borderColor(tokens.colorNeutralStroke1Pressed), | ||
borderBottomColor: tokens.colorNeutralStrokeAccessible, | ||
}, | ||
}, | ||
underline: { | ||
backgroundColor: tokens.colorTransparentBackground, | ||
|
@@ -147,7 +183,6 @@ const useIconStyles = makeStyles({ | |
color: tokens.colorNeutralStrokeAccessible, | ||
display: 'block', | ||
position: 'absolute', | ||
right: tokens.spacingHorizontalMNudge, | ||
pointerEvents: 'none', | ||
|
||
// the SVG must have display: block for accurate positioning | ||
|
@@ -165,22 +200,19 @@ const useIconStyles = makeStyles({ | |
small: { | ||
fontSize: iconSizes.small, | ||
height: iconSizes.small, | ||
paddingRight: tokens.spacingHorizontalSNudge, | ||
paddingLeft: tokens.spacingHorizontalXXS, | ||
right: tokens.spacingHorizontalSNudge, | ||
width: iconSizes.small, | ||
}, | ||
medium: { | ||
fontSize: iconSizes.medium, | ||
height: iconSizes.medium, | ||
paddingRight: tokens.spacingHorizontalM, | ||
paddingLeft: tokens.spacingHorizontalXXS, | ||
right: tokens.spacingHorizontalMNudge, | ||
width: iconSizes.medium, | ||
}, | ||
large: { | ||
fontSize: iconSizes.large, | ||
height: iconSizes.large, | ||
paddingRight: tokens.spacingHorizontalM, | ||
paddingLeft: tokens.spacingHorizontalSNudge, | ||
right: tokens.spacingHorizontalM, | ||
width: iconSizes.large, | ||
}, | ||
}); | ||
|
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
paddingBottom/Top
values are the same for all sizes. Can these be moved to thebase
styles?