diff --git a/common/changes/office-ui-fabric-react/ButtonEx-mergestyles_2018-02-01-19-14.json b/common/changes/office-ui-fabric-react/ButtonEx-mergestyles_2018-02-01-19-14.json new file mode 100644 index 00000000000000..8b47a90cb51d55 --- /dev/null +++ b/common/changes/office-ui-fabric-react/ButtonEx-mergestyles_2018-02-01-19-14.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "office-ui-fabric-react", + "comment": "Converted ButtonBasicExample to use mergeStyles instead of SCSS.", + "type": "patch" + } + ], + "packageName": "office-ui-fabric-react", + "email": "v-brgarl@microsoft.com" +} \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Button/ButtonPage.tsx b/packages/office-ui-fabric-react/src/components/Button/ButtonPage.tsx index ee0ef8aa003cf2..0cdcf9100cfc6e 100644 --- a/packages/office-ui-fabric-react/src/components/Button/ButtonPage.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/ButtonPage.tsx @@ -20,7 +20,6 @@ import { ButtonSplitExample, ButtonSplitCustomExample } from './examples/Button. import { ComponentStatus } from '../../demo/ComponentStatus/ComponentStatus'; import { Checkbox } from 'office-ui-fabric-react/lib/Checkbox'; import { Link } from '../../Link'; -import './examples/Button.Basic.Example.scss'; import * as exampleStylesImport from '../../common/_exampleStyles.scss'; const exampleStyles: any = exampleStylesImport; diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Action.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Action.Example.tsx index e6365cb5769c9d..7dcfd418f4b1f2 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Action.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Action.Example.tsx @@ -1,4 +1,10 @@ import * as React from 'react'; +import { css, classNamesFunction } from '../../../Utilities'; +import { + getStyles, + IButtonBasicExampleStyleProps, + IButtonBasicExampleStyles +} from './Button.Basic.Example.styles'; import { ActionButton, IButtonProps @@ -12,8 +18,11 @@ export class ButtonActionExample extends React.Component { public render() { let { disabled, checked } = this.props; + const getClassNames = classNamesFunction(); + const classNames = getClassNames(getStyles); + return ( -
+
{ public render() { let { disabled, checked } = this.props; + const getClassNames = classNamesFunction(); + const classNames = getClassNames(getStyles); + return ( -
+
* { - flex-grow: 1; - } - .ms-Label { - margin-bottom: 10px; - } - } -} \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Basic.Example.styles.ts b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Basic.Example.styles.ts new file mode 100644 index 00000000000000..dea19c6a76381f --- /dev/null +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Basic.Example.styles.ts @@ -0,0 +1,41 @@ +import { IStyle } from '../../../Styling'; + +export interface IButtonBasicExampleStyleProps { + /** + * 404 No Style Props Found + */ +} + +export interface IButtonBasicExampleStyles { + example?: IStyle; + twoup?: IStyle; +} + +export function getStyles(props: IButtonBasicExampleStyleProps): IButtonBasicExampleStyles { + return ({ + example: [ + 'ms-BasicButtonsExample', + { + selectors: { + '.ms-Button': { + margin: '10px 0' + } + } + } + ], + twoup: [ + 'ms-BasicButtonsTwoUp', + { + display: 'flex', + selectors: { + '& > *': { + flexGrow: 1 + }, + '.ms-Label': { + marginBottom: '10px' + } + } + } + ] + }); +} diff --git a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Compound.Example.tsx b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Compound.Example.tsx index 1c11cbc0a92d45..92c31dded940ab 100644 --- a/packages/office-ui-fabric-react/src/components/Button/examples/Button.Compound.Example.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/examples/Button.Compound.Example.tsx @@ -1,4 +1,10 @@ import * as React from 'react'; +import { css, classNamesFunction } from '../../../Utilities'; +import { + getStyles, + IButtonBasicExampleStyleProps, + IButtonBasicExampleStyles +} from './Button.Basic.Example.styles'; import { CompoundButton, IButtonProps @@ -13,8 +19,11 @@ export class ButtonCompoundExample extends React.Component { public render() { let { disabled, checked } = this.props; + const getClassNames = classNamesFunction(); + const classNames = getClassNames(getStyles); + return ( -
+
{ public render() { let { disabled, checked } = this.props; + const getClassNames = classNamesFunction(); + const classNames = getClassNames(getStyles); + return ( -
+
{ public render() { let { disabled, checked } = this.props; + const getClassNames = classNamesFunction(); + const classNames = getClassNames(getStyles); + return ( -
+
{ public render() { let { disabled, checked } = this.props; + const getClassNames = classNamesFunction(); + const classNames = getClassNames(getStyles); + return ( -
+
public render() { let { disabled, checked } = this.props; + const getClassNames = classNamesFunction(); + const classNames = getClassNames(getStyles); + return ( -
+
{ public render() { let { disabled, checked } = this.props; + const getClassNames = classNamesFunction(); + const classNames = getClassNames(getStyles); + return ( -
+
); + const getClassNames = classNamesFunction(); + const classNames = getClassNames(getStyles); + return ( -
+
{ button }
);