Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 2689e7a

Browse files
authored
fix(Button): Add new color scheme tokens & update iconOnly button styles for Teams theme (#2211)
* add background5 to default color scheme for muted avatar backgrounds * update changelog * updating hover/focus iconOnly buttons to have the correct focus and hover states and use the new backgroundHover2 token * update changelog entry * update attachment styles to not have background color on button in attachment on hover
1 parent 636445d commit 2689e7a

File tree

7 files changed

+21
-2
lines changed

7 files changed

+21
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
3232
- Fix event listener leak in `FocusZone` @miroslavstastny ([#2227](https://github.com/microsoft/fluent-ui-react/pull/2227))
3333
- Fix styleParam to always be required in the styles functions @layershifter, @mnajdova ([#2235](https://github.com/microsoft/fluent-ui-react/pull/2235))
3434
- Check input and button refs exist before focus in `Dropdown` @silviuavram ([#2248](https://github.com/microsoft/fluent-ui-react/pull/2248))
35+
- Update iconOnly button hover, focus styles and add new `background5` and `backgroundHover2` design tokens in Teams theme @codepretty ([#2211](https://github.com/microsoft/fluent-ui-react/pull/2211))
3536
- Fix `forceUpdate` to get synced updates in React's Concurrent mode @layershifter ([#2268](https://github.com/microsoft/fluent-ui-react/pull/2268))
3637
- Fix element reference memory leaks @jurokapsiar ([#2270](https://github.com/microsoft/fluent-ui-react/pull/2270))
3738
- Adding actionable items into `Carousel` @kolaps33 ([#2271](https://github.com/microsoft/fluent-ui-react/pull/2271))

packages/react/src/themes/teams-dark/colors.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const colorScheme: ColorSchemeMapping = {
1616
background2: colors.grey[800],
1717
background3: colors.grey[550],
1818
background4: colors.grey[600],
19+
background5: colors.grey[250],
1920

2021
border: colors.grey[450], // buttons
2122
border1: colors.grey[850],
@@ -31,6 +32,7 @@ export const colorScheme: ColorSchemeMapping = {
3132

3233
backgroundHover: colors.grey[550],
3334
backgroundHover1: colors.grey[550],
35+
backgroundHover2: 'transparent',
3436

3537
borderHover: colors.grey[400],
3638

packages/react/src/themes/teams-high-contrast/colors.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const colorScheme: ColorSchemeMapping = {
5757
background2: colors.black,
5858
background3: colors.black,
5959
background4: colors.black,
60+
background5: accessibleYellow,
6061

6162
border: colors.white,
6263
border1: colors.white,
@@ -72,6 +73,7 @@ export const colorScheme: ColorSchemeMapping = {
7273

7374
backgroundHover: accessibleYellow,
7475
backgroundHover1: accessibleYellow,
76+
backgroundHover2: accessibleYellow,
7577

7678
borderHover: accessibleYellow,
7779

packages/react/src/themes/teams/colors.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ export const colorScheme: ColorSchemeMapping<ColorScheme, TeamsColorNames> = {
228228
background2: colors.grey[100],
229229
background3: colors.grey[150],
230230
background4: colors.grey[100],
231+
background5: colors.grey[350],
231232

232233
border: colors.grey[200], // buttons
233234
border1: colors.grey[150],
@@ -243,6 +244,7 @@ export const colorScheme: ColorSchemeMapping<ColorScheme, TeamsColorNames> = {
243244

244245
backgroundHover: colors.grey[100],
245246
backgroundHover1: colors.grey[150],
247+
backgroundHover2: 'transparent',
246248

247249
borderHover: colors.grey[250], // buttons
248250

packages/react/src/themes/teams/components/Attachment/attachmentStyles.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ const attachmentStyles: ComponentSlotStylesPrepared<AttachmentProps, AttachmentV
7474

7575
...getIconFillOrOutlineStyles({ outline: true }),
7676

77-
':hover': iconFilledStyles,
77+
':hover': {
78+
iconFilledStyles,
79+
background: 'transparent',
80+
},
7881

7982
':focus': borderFocusStyles[':focus'],
8083
':focus-visible': {

packages/react/src/themes/teams/components/Button/buttonStyles.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ const buttonStyles: ComponentSlotStylesPrepared<ButtonStylesProps, ButtonVariabl
132132

133133
':focus-visible': {
134134
...borderFocusStyles[':focus-visible'],
135-
...getIconFillOrOutlineStyles({ outline: false }),
136135
},
137136

138137
...(p.primary && {
@@ -229,6 +228,12 @@ const buttonStyles: ComponentSlotStylesPrepared<ButtonStylesProps, ButtonVariabl
229228
minWidth: v.height,
230229
padding: 0,
231230

231+
':hover': {
232+
...getIconFillOrOutlineStyles({ outline: false }),
233+
color: v.textColorIconOnlyHover,
234+
background: v.backgroundColorIconOnlyHover,
235+
},
236+
232237
...(p.size === 'small' && {
233238
minWidth: v.sizeSmallHeight,
234239
}),

packages/react/src/themes/teams/components/Button/buttonVariables.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export interface ButtonVariables {
2020
backgroundColor: string
2121
backgroundColorActive: string
2222
backgroundColorHover: string
23+
backgroundColorIconOnlyHover: string
2324

2425
backgroundColorDisabled: string
2526
borderColor: string
@@ -42,6 +43,7 @@ export interface ButtonVariables {
4243
textPrimaryColor: string
4344
textPrimaryColorHover: string
4445
textColorDisabled: string
46+
textColorIconOnlyHover: string
4547

4648
primaryBoxShadow: string
4749
boxShadow: string
@@ -86,6 +88,7 @@ export default (siteVars: any): ButtonVariables => ({
8688
borderColorHover: siteVars.colorScheme.default.borderHover,
8789
borderColorActive: siteVars.colorScheme.default.borderPressed,
8890
borderColorDisabled: 'transparent',
91+
backgroundColorIconOnlyHover: siteVars.colorScheme.default.backgroundHover2,
8992

9093
primaryColor: siteVars.colorScheme.brand.foreground4,
9194
primaryColorHover: siteVars.colorScheme.brand.foreground4,
@@ -102,6 +105,7 @@ export default (siteVars: any): ButtonVariables => ({
102105
textPrimaryColor: siteVars.colorScheme.brand.foreground,
103106
textPrimaryColorHover: siteVars.colorScheme.brand.foreground1,
104107
textColorDisabled: siteVars.colorScheme.brand.foregroundDisabled1,
108+
textColorIconOnlyHover: siteVars.colorScheme.brand.foregroundHover,
105109

106110
primaryBoxShadow: siteVars.shadowLevel1Dark,
107111
boxShadow: siteVars.shadowLevel1,

0 commit comments

Comments
 (0)