-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Adjusting split button paddings and icon sizes to fit nee design requests #34048
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
base: master
Are you sure you want to change the base?
Conversation
📊 Bundle size reportUnchanged fixtures
|
Pull request demo site: URL |
@microsoft-github-policy-service agree company="Microsoft" |
@@ -0,0 +1,7 @@ | |||
{ |
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.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/Positioning 2 screenshots
Image Name | Diff(in Pixels) | Image Type |
---|---|---|
vr-tests-react-components/Positioning.Positioning end.chromium.png | 607 | Changed |
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png | 850 | Changed |
vr-tests-react-components/SplitButton Converged 11 screenshots
Image Name | Diff(in Pixels) | Image Type |
---|---|---|
vr-tests-react-components/SplitButton Converged.Subtle - High Contrast.pressed.chromium.png | 10 | Changed |
vr-tests-react-components/SplitButton Converged.Subtle Disabled - Dark Mode.default.chromium.png | 2 | Changed |
vr-tests-react-components/SplitButton Converged.Subtle Disabled - High Contrast.hover.chromium.png | 6 | Changed |
vr-tests-react-components/SplitButton Converged.Subtle Disabled.pressed.chromium.png | 2 | Changed |
vr-tests-react-components/SplitButton Converged.Subtle.pressed.chromium.png | 7 | Changed |
vr-tests-react-components/SplitButton Converged.Transparent - Dark Mode.pressed.chromium.png | 11 | Changed |
vr-tests-react-components/SplitButton Converged.Transparent - High Contrast.default.chromium.png | 16 | Changed |
vr-tests-react-components/SplitButton Converged.Transparent - High Contrast.pressed.chromium.png | 231 | Changed |
vr-tests-react-components/SplitButton Converged.Transparent Disabled - High Contrast.pressed.chromium.png | 50 | Changed |
vr-tests-react-components/SplitButton Converged.Transparent Disabled.pressed.chromium.png | 11 | Changed |
vr-tests-react-components/SplitButton Converged.Transparent.hover.chromium.png | 12 | Changed |
There were 25 duplicate changes discarded. Check the build logs for more information.
let menuButtonSize = size; | ||
if (size === 'medium' && (appearance === 'transparent' || appearance === 'subtle')) { | ||
menuButtonSize = '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.
I think this might be better put as part of only the styles and not in the state here.
...ct-components/react-button/library/src/components/SplitButton/useSplitButtonStyles.styles.ts
Outdated
Show resolved
Hide resolved
change/@fluentui-react-button-96a1c9d2-3ee4-41f8-ae2d-f98f20b6cbbb.json
Outdated
Show resolved
Hide resolved
@@ -10,6 +10,8 @@ export const splitButtonClassNames: SlotClassNames<SplitButtonSlots> = { | |||
primaryActionButton: 'fui-SplitButton__primaryActionButton', | |||
}; | |||
|
|||
const menuButtonIconClass = 'fui-MenuButton__menuIcon'; |
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 think you can just import this from ../useMenuButtonStyles.styles.ts
as
import { menuButtonClassNames } from '../useMenuButtonStyles.styles.ts';
@@ -170,6 +172,14 @@ const useRootStyles = makeStyles({ | |||
}, | |||
}, | |||
}, | |||
|
|||
largeChevron: { | |||
[`& .${menuButtonIconClass}`]: { |
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.
And then use it here as:
[`& .${menuButtonIconClass}`]: { | |
[`& .${menuButtonClassNames.menuIcon}`]: { |
? !state.primaryActionButton.children && appearance && iconOnlyStyles[appearance] | ||
: undefined; | ||
|
||
const forceLargeChevron = size === 'medium' && (appearance === 'transparent' || appearance === 'subtle'); |
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.
nit: Name it as a conditional
const forceLargeChevron = size === 'medium' && (appearance === 'transparent' || appearance === 'subtle'); | |
const shouldForceLargeChevron = size === 'medium' && (appearance === 'transparent' || appearance === 'subtle'); |
state.root.className = mergeClasses( | ||
splitButtonClassNames.root, | ||
rootStyles.base, | ||
appearance && rootStyles[appearance], | ||
noIconClass, | ||
iconOnlyClassName, | ||
forceLargeChevron && rootStyles.largeChevron, |
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.
If you go with my suggestion above
forceLargeChevron && rootStyles.largeChevron, | |
shouldForceLargeChevron && rootStyles.largeChevron, |
[`& .${splitButtonClassNames.primaryActionButton}`]: { | ||
paddingRight: tokens.spacingVerticalNone, | ||
}, | ||
[`& .${splitButtonClassNames.menuButton}`]: { | ||
paddingLeft: tokens.spacingVerticalNone, | ||
paddingRight: tokens.spacingVerticalNone, | ||
}, |
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 just noticed that you have access to these slots directly, so you should probably apply these styles directly and not through a children selector to not mess with style specification.
Uh oh!
There was an error while loading. Please reload this page.