diff --git a/common/changes/@uifabric/styling/phkuo-glamor_2017-05-31-22-58.json b/common/changes/@uifabric/styling/phkuo-glamor_2017-05-31-22-58.json new file mode 100644 index 0000000000000..25d0775f40bbc --- /dev/null +++ b/common/changes/@uifabric/styling/phkuo-glamor_2017-05-31-22-58.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@uifabric/styling", + "comment": "add more semantic color slots", + "type": "minor" + } + ], + "packageName": "@uifabric/styling", + "email": "phkuo@microsoft.com" +} diff --git a/packages/office-ui-fabric-react/src/components/Toggle/Toggle.styles.ts b/packages/office-ui-fabric-react/src/components/Toggle/Toggle.styles.ts index c2d630a3a39f3..49faaf10ba73c 100644 --- a/packages/office-ui-fabric-react/src/components/Toggle/Toggle.styles.ts +++ b/packages/office-ui-fabric-react/src/components/Toggle/Toggle.styles.ts @@ -13,11 +13,11 @@ export const getStyles = memoizeFunction(( ): IToggleStyles => { const { semanticColors } = theme; const pillUncheckedBackground = semanticColors.bodyBackground; - const pillCheckedBackground = semanticColors.inputBackgroundSelected; - const pillCheckedHoveredBackground = semanticColors.inputBackgroundSelectedHovered; + const pillCheckedBackground = semanticColors.inputBackgroundChecked; + const pillCheckedHoveredBackground = semanticColors.inputBackgroundCheckedHovered; const pillCheckedDisabledBackground = semanticColors.disabledText; const thumbBackground = semanticColors.inputBorderHovered; - const thumbCheckedBackground = semanticColors.inputForegroundSelected; + const thumbCheckedBackground = semanticColors.inputForegroundChecked; const thumbDisabledBackground = semanticColors.disabledText; const thumbCheckedDisabledBackground = semanticColors.disabledBackground; const pillBorderColor = semanticColors.inputBorder; diff --git a/packages/styling/src/interfaces/ISemanticColors.ts b/packages/styling/src/interfaces/ISemanticColors.ts index 8695b135e71da..938c2fa12f452 100644 --- a/packages/styling/src/interfaces/ISemanticColors.ts +++ b/packages/styling/src/interfaces/ISemanticColors.ts @@ -1,31 +1,147 @@ /** + * * The collection of semantic slots for colors used in themes. - * See documentation [todo] - */ + +Naming Convention +The name of a semantic slot can quickly tell you how it’s meant to be used. It generally follows this format: +[category name][element name][checked state][hovered/pressed/disabled state] +[category name] – The “family” that this slot belongs to. +[element name] – The name of the thing being targeted, such as the background or border. +[checked state] – Whether the thing is checked. We assume things are unchecked by default, so no need to specify the unchecked state. +(We used “checked” to refer to anything that is on, selected, toggled, highlighted, emphasized, etc.) +[hovered/pressed/disabled state] – One of these states, if applicable. Each of these states are mutually exclusive. +Pressed styles overwrite hovered styles, and disabled elements cannot be hovered or pressed. + +Base/Body +A basic set of slots that provide many default body styles, such as text, subtext, disabled colors, error text, and so on. +If a category doesn't provide the slot you're looking for, use one from this category. +For example, the placeholder text on a text input field has no corresponding slot in its category, +so you'd use the bodySubtextColor from this category. + +Input Controls +This category contains input components commonly used to denote state, including radio buttons, +check boxes, toggle switches, sliders, progress bars, and more. + +Menus +Any kind of popup menus uses this category. + +Lists +Lists differ from menus in that they are designed to show infinite amounts of items, often scroll, +and have a large and complex interaction surface. +This category covers all kinds of lists, whether they're typical one-item-per-row lists (like DetailsList) or ones with a tiled layout. + +*/ export interface ISemanticColors { + /* ANY ADDITIONS/REMOVALS HERE MUST ALSO BE MADE TO \packages\styling\src\utilities\theme.ts:_makeSemanticColorsFromPalette() */ + /** - * ANY ADDITIONS/REMOVALS HERE MUST ALSO BE MADE TO \packages\styling\src\utilities\theme.ts:_makeSemanticColorsFromPalette() + * The default color for backgrounds. */ - - // Base slots defining universal colors bodyBackground?: string; + /** + * The default color for text. + */ bodyText?: string; + /** + * De-emphasized text; e.g. metadata, captions, placeholder text. + */ bodySubtext?: string; + /** + * Divider lines; e.g. lines that separate sections in a menu, an