diff --git a/common/changes/contextual-menu-item-styles_2017-03-03-22-07.json b/common/changes/contextual-menu-item-styles_2017-03-03-22-07.json new file mode 100644 index 00000000000000..f03dc71ee7ee92 --- /dev/null +++ b/common/changes/contextual-menu-item-styles_2017-03-03-22-07.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "office-ui-fabric-react", + "comment": "Contextual Menu: allow developers to specify inline styles for menu items", + "type": "minor" + } + ], + "email": "miclo@microsoft.com" +} \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/ContextualMenu/ContextualMenu.Props.ts b/packages/office-ui-fabric-react/src/components/ContextualMenu/ContextualMenu.Props.ts index 76efa4cfb7c767..1ee025be1c5980 100644 --- a/packages/office-ui-fabric-react/src/components/ContextualMenu/ContextualMenu.Props.ts +++ b/packages/office-ui-fabric-react/src/components/ContextualMenu/ContextualMenu.Props.ts @@ -246,6 +246,12 @@ export interface IContextualMenuItem { */ className?: string; + /** + * Additional styles to apply to the menu item + * @defaultvalue undefined + */ + style?: React.CSSProperties; + /** * Optional accessibility label (aria-label) attribute that will be stamped on to the element. * If none is specified, the arai-label attribute will contain the item name diff --git a/packages/office-ui-fabric-react/src/components/ContextualMenu/ContextualMenu.tsx b/packages/office-ui-fabric-react/src/components/ContextualMenu/ContextualMenu.tsx index 21e9db007f5ace..539aaa15ee529e 100644 --- a/packages/office-ui-fabric-react/src/components/ContextualMenu/ContextualMenu.tsx +++ b/packages/office-ui-fabric-react/src/components/ContextualMenu/ContextualMenu.tsx @@ -292,7 +292,7 @@ export class ContextualMenu extends BaseComponent +
{ this._renderMenuItemChildren(item, index, hasCheckmarks, hasIcons) }
); } @@ -308,6 +308,7 @@ export class ContextualMenu extends BaseComponent { (hasIcons) ? ( this._renderIcon(item) @@ -346,7 +347,8 @@ export class ContextualMenu extends BaseComponent