Skip to content
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

SplitButton: Fixing some styling bugs related to the divider #9246

Merged
merged 2 commits into from
May 28, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@uifabric/experiments",
"comment": "SplitButton: Fixing some styling bugs related to the divider.",
"type": "patch"
}
],
"packageName": "@uifabric/experiments",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const SplitButtonStyles: ISplitButtonComponent['styles'] = (props, theme,
borderRightWidth: 0,
borderTopWidth: props.primaryActionDisabled ? 0 : tokens.borderWidth,
boxSizing: 'border-box',
height: '100%',
height: 'auto',
width: 'auto',

selectors: {
Expand All @@ -154,9 +154,8 @@ export const SplitButtonStyles: ISplitButtonComponent['styles'] = (props, theme,
},
splitDivider: {
backgroundColor: props.primaryActionDisabled ? semanticColors.menuDivider : tokens.dividerColor,
boxSizing: 'border-box',
display: 'inline-block',
height: 'calc(100% - 14px)',
height: '100%',
margin: '7px 0px',
width: '1px'
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IStackSlot, IStackItemSlot } from 'office-ui-fabric-react';
import { IStackSlot } from 'office-ui-fabric-react';
import { IComponent, IComponentStyles, IHTMLSlot, ISlotProp, ISlottableProps, IStyleableComponentProps } from '../../../Foundation';
import { IBaseProps } from '../../../Utilities';
import { INativeButtonProps } from '../Button.types';
Expand Down Expand Up @@ -50,7 +50,7 @@ export interface ISplitButtonSlots extends IMenuButtonSlots {
/**
* Defines the container for the divider that is used for styling purposes.
*/
splitDividerContainer?: IStackItemSlot;
splitDividerContainer?: IStackSlot;

/**
* Defines the divider that separates the left and right parts of a SplitButton.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const SplitButtonView: ISplitButtonComponent['view'] = props => {
content: Text,
menu: ContextualMenu,
menuIcon: Icon,
splitDividerContainer: Stack.Item,
splitDividerContainer: Stack,
splitDivider: 'span'
});

Expand All @@ -54,12 +54,15 @@ export const SplitButtonView: ISplitButtonComponent['view'] = props => {
backgroundColor,
backgroundColorHovered,
backgroundColorPressed,
borderColor,
borderColorHovered,
borderColorPressed,
color,
colorHovered,
colorPressed,
...nonColoredButtonTokens
} = splitButtonTokens;
const buttonTokens = primaryActionDisabled ? { contentPadding, contentPaddingFocused, nonColoredButtonTokens } : tokens;
const buttonTokens = primaryActionDisabled ? { contentPadding, contentPaddingFocused, ...nonColoredButtonTokens } : tokens;
const menuButtonTokens = { contentPadding: secondaryPadding, ...splitButtonTokens };

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ const SplitMenuButtonVerticalStyles: ISplitRibbonMenuButtonProps['styles'] = (pr
borderLeftWidth: tokens.borderWidth,
borderRightWidth: tokens.borderWidth,
borderTopWidth: 0
},
splitDividerContainer: {
borderWidth: 0
}
};
};
Expand Down