-
Notifications
You must be signed in to change notification settings - Fork 2.9k
BREAKING: reduce shared colors #23578
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
Closed
Miroslav Stastny (miroslavstastny)
wants to merge
8
commits into
microsoft:master
from
miroslavstastny:feat/reduce-shared-colors
Closed
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6d36ccf
BREAKING: reduce shared colors
miroslavstastny d97e791
fix shared colors in teamsDark theme
miroslavstastny bf48371
change files
miroslavstastny d523070
update tokens in appearance stories
miroslavstastny 14c3d12
fix colors in vr test
miroslavstastny 730b637
re-add LightGreen and Marigold as status shared colors, cleanup
miroslavstastny 9d9ff45
revert PresenceBadge color changes
miroslavstastny cd18a12
update colors story
miroslavstastny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-badge-31a8f2fe-abb3-4ffc-b05d-17eb9e76860c.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "Update StatusBadge colors", | ||
| "packageName": "@fluentui/react-badge", | ||
| "email": "miroslav.stastny@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-theme-5e458883-a508-46fb-ae22-cb2c2e6614f1.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "BREAKING: reduce shared colors", | ||
| "packageName": "@fluentui/react-theme", | ||
| "email": "miroslav.stastny@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-theme-sass-86fb34a1-f4cc-4a04-b3be-0d95c3c7f338.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "BREAKING: reduce shared colors", | ||
| "packageName": "@fluentui/react-theme-sass", | ||
| "email": "miroslav.stastny@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
416 changes: 46 additions & 370 deletions
416
packages/react-components/react-theme-sass/sass/colorPaletteTokens.scss
Large diffs are not rendered by default.
Oops, something went wrong.
90 changes: 45 additions & 45 deletions
90
packages/react-components/react-theme/etc/react-theme.api.md
Large diffs are not rendered by default.
Oops, something went wrong.
43 changes: 29 additions & 14 deletions
43
packages/react-components/react-theme/src/alias/darkColorPalette.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,36 @@ | ||
| import { sharedColors } from '../global/colors'; | ||
| import { ColorPaletteTokens, GlobalSharedColors } from '../types'; | ||
| import { statusSharedColors, personaSharedColors, StatusSharedColors, PersonaSharedColors } from '../global/colors'; | ||
| import { ColorPaletteTokens, GlobalSharedColors, PersonaColorPaletteTokens, StatusColorPaletteTokens } from '../types'; | ||
|
|
||
| export const colorPaletteTokens: ColorPaletteTokens = (Object.keys(sharedColors) as Array< | ||
| keyof GlobalSharedColors | ||
| const statusColorPaletteTokens = (Object.keys(statusSharedColors) as Array< | ||
| keyof Pick<GlobalSharedColors, StatusSharedColors> | ||
| >).reduce((acc, sharedColor) => { | ||
| const color = sharedColor.slice(0, 1).toUpperCase() + sharedColor.slice(1); | ||
| const sharedColorTokens = { | ||
| [`colorPalette${color}Background1`]: sharedColors[sharedColor].shade40, | ||
| [`colorPalette${color}Background2`]: sharedColors[sharedColor].shade30, | ||
| [`colorPalette${color}Background3`]: sharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Foreground1`]: sharedColors[sharedColor].tint30, | ||
| [`colorPalette${color}Foreground2`]: sharedColors[sharedColor].tint40, | ||
| [`colorPalette${color}Foreground3`]: sharedColors[sharedColor].tint20, | ||
| [`colorPalette${color}BorderActive`]: sharedColors[sharedColor].tint30, | ||
| [`colorPalette${color}Border1`]: sharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Border2`]: sharedColors[sharedColor].tint20, | ||
| [`colorPalette${color}Background1`]: statusSharedColors[sharedColor].shade40, | ||
| [`colorPalette${color}Background2`]: statusSharedColors[sharedColor].shade30, | ||
| [`colorPalette${color}Background3`]: statusSharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Foreground1`]: statusSharedColors[sharedColor].tint30, | ||
| [`colorPalette${color}Foreground2`]: statusSharedColors[sharedColor].tint40, | ||
| [`colorPalette${color}Foreground3`]: statusSharedColors[sharedColor].tint20, | ||
| [`colorPalette${color}BorderActive`]: statusSharedColors[sharedColor].tint30, | ||
| [`colorPalette${color}Border1`]: statusSharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Border2`]: statusSharedColors[sharedColor].tint20, | ||
| }; | ||
|
|
||
| return { ...acc, ...sharedColorTokens }; | ||
| }, {} as ColorPaletteTokens); | ||
| }, {} as StatusColorPaletteTokens); | ||
|
|
||
| const personaColorPaletteTokens = (Object.keys(personaSharedColors) as Array< | ||
| keyof Pick<GlobalSharedColors, PersonaSharedColors> | ||
| >).reduce((acc, sharedColor) => { | ||
| const color = sharedColor.slice(0, 1).toUpperCase() + sharedColor.slice(1); | ||
| const sharedColorTokens = { | ||
| [`colorPalette${color}Background2`]: personaSharedColors[sharedColor].shade30, | ||
| [`colorPalette${color}Foreground2`]: personaSharedColors[sharedColor].tint40, | ||
| [`colorPalette${color}BorderActive`]: personaSharedColors[sharedColor].tint30, | ||
| }; | ||
|
|
||
| return { ...acc, ...sharedColorTokens }; | ||
| }, {} as PersonaColorPaletteTokens); | ||
|
|
||
| export const colorPaletteTokens: ColorPaletteTokens = { ...statusColorPaletteTokens, ...personaColorPaletteTokens }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 29 additions & 14 deletions
43
packages/react-components/react-theme/src/alias/lightColorPalette.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,36 @@ | ||
| import { sharedColors } from '../global/colors'; | ||
| import { ColorPaletteTokens, GlobalSharedColors } from '../types'; | ||
| import { statusSharedColors, personaSharedColors, StatusSharedColors, PersonaSharedColors } from '../global/colors'; | ||
| import { ColorPaletteTokens, GlobalSharedColors, PersonaColorPaletteTokens, StatusColorPaletteTokens } from '../types'; | ||
|
|
||
| export const colorPaletteTokens: ColorPaletteTokens = (Object.keys(sharedColors) as Array< | ||
| keyof GlobalSharedColors | ||
| const statusColorPaletteTokens = (Object.keys(statusSharedColors) as Array< | ||
| keyof Pick<GlobalSharedColors, StatusSharedColors> | ||
| >).reduce((acc, sharedColor) => { | ||
| const color = sharedColor.slice(0, 1).toUpperCase() + sharedColor.slice(1); | ||
| const sharedColorTokens = { | ||
| [`colorPalette${color}Background1`]: sharedColors[sharedColor].tint60, | ||
| [`colorPalette${color}Background2`]: sharedColors[sharedColor].tint40, | ||
| [`colorPalette${color}Background3`]: sharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Foreground1`]: sharedColors[sharedColor].shade10, | ||
| [`colorPalette${color}Foreground2`]: sharedColors[sharedColor].shade30, | ||
| [`colorPalette${color}Foreground3`]: sharedColors[sharedColor].primary, | ||
| [`colorPalette${color}BorderActive`]: sharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Border1`]: sharedColors[sharedColor].tint40, | ||
| [`colorPalette${color}Border2`]: sharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Background1`]: statusSharedColors[sharedColor].tint60, | ||
| [`colorPalette${color}Background2`]: statusSharedColors[sharedColor].tint40, | ||
| [`colorPalette${color}Background3`]: statusSharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Foreground1`]: statusSharedColors[sharedColor].shade10, | ||
| [`colorPalette${color}Foreground2`]: statusSharedColors[sharedColor].shade30, | ||
| [`colorPalette${color}Foreground3`]: statusSharedColors[sharedColor].primary, | ||
| [`colorPalette${color}BorderActive`]: statusSharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Border1`]: statusSharedColors[sharedColor].tint40, | ||
| [`colorPalette${color}Border2`]: statusSharedColors[sharedColor].primary, | ||
| }; | ||
|
|
||
| return { ...acc, ...sharedColorTokens }; | ||
| }, {} as ColorPaletteTokens); | ||
| }, {} as StatusColorPaletteTokens); | ||
|
|
||
| const personaColorPaletteTokens = (Object.keys(personaSharedColors) as Array< | ||
| keyof Pick<GlobalSharedColors, PersonaSharedColors> | ||
| >).reduce((acc, sharedColor) => { | ||
| const color = sharedColor.slice(0, 1).toUpperCase() + sharedColor.slice(1); | ||
| const sharedColorTokens = { | ||
| [`colorPalette${color}Background2`]: personaSharedColors[sharedColor].tint40, | ||
| [`colorPalette${color}Foreground2`]: personaSharedColors[sharedColor].shade30, | ||
| [`colorPalette${color}BorderActive`]: personaSharedColors[sharedColor].primary, | ||
| }; | ||
|
|
||
| return { ...acc, ...sharedColorTokens }; | ||
| }, {} as PersonaColorPaletteTokens); | ||
|
|
||
| export const colorPaletteTokens: ColorPaletteTokens = { ...statusColorPaletteTokens, ...personaColorPaletteTokens }; |
43 changes: 29 additions & 14 deletions
43
packages/react-components/react-theme/src/alias/teamsDarkColorPalette.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,36 @@ | ||
| import { sharedColors } from '../global/colors'; | ||
| import { ColorPaletteTokens, GlobalSharedColors } from '../types'; | ||
| import { statusSharedColors, personaSharedColors, StatusSharedColors, PersonaSharedColors } from '../global/colors'; | ||
| import { ColorPaletteTokens, GlobalSharedColors, PersonaColorPaletteTokens, StatusColorPaletteTokens } from '../types'; | ||
|
|
||
| export const colorPaletteTokens: ColorPaletteTokens = (Object.keys(sharedColors) as Array< | ||
| keyof GlobalSharedColors | ||
| const statusColorPaletteTokens = (Object.keys(statusSharedColors) as Array< | ||
| keyof Pick<GlobalSharedColors, StatusSharedColors> | ||
| >).reduce((acc, sharedColor) => { | ||
| const color = sharedColor.slice(0, 1).toUpperCase() + sharedColor.slice(1); | ||
| const sharedColorTokens = { | ||
| [`colorPalette${color}Background1`]: sharedColors[sharedColor].shade40, | ||
| [`colorPalette${color}Background2`]: sharedColors[sharedColor].shade30, | ||
| [`colorPalette${color}Background3`]: sharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Foreground1`]: sharedColors[sharedColor].tint30, | ||
| [`colorPalette${color}Foreground2`]: sharedColors[sharedColor].tint40, | ||
| [`colorPalette${color}Foreground3`]: sharedColors[sharedColor].tint20, | ||
| [`colorPalette${color}BorderActive`]: sharedColors[sharedColor].tint30, | ||
| [`colorPalette${color}Border1`]: sharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Border2`]: sharedColors[sharedColor].tint20, | ||
| [`colorPalette${color}Background1`]: statusSharedColors[sharedColor].shade40, | ||
| [`colorPalette${color}Background2`]: statusSharedColors[sharedColor].shade30, | ||
| [`colorPalette${color}Background3`]: statusSharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Foreground1`]: statusSharedColors[sharedColor].tint30, | ||
| [`colorPalette${color}Foreground2`]: statusSharedColors[sharedColor].tint40, | ||
| [`colorPalette${color}Foreground3`]: statusSharedColors[sharedColor].tint20, | ||
| [`colorPalette${color}BorderActive`]: statusSharedColors[sharedColor].tint30, | ||
| [`colorPalette${color}Border1`]: statusSharedColors[sharedColor].primary, | ||
| [`colorPalette${color}Border2`]: statusSharedColors[sharedColor].tint20, | ||
| }; | ||
|
|
||
| return { ...acc, ...sharedColorTokens }; | ||
| }, {} as ColorPaletteTokens); | ||
| }, {} as StatusColorPaletteTokens); | ||
|
|
||
| const personaColorPaletteTokens = (Object.keys(personaSharedColors) as Array< | ||
| keyof Pick<GlobalSharedColors, PersonaSharedColors> | ||
| >).reduce((acc, sharedColor) => { | ||
| const color = sharedColor.slice(0, 1).toUpperCase() + sharedColor.slice(1); | ||
| const sharedColorTokens = { | ||
| [`colorPalette${color}Background2`]: personaSharedColors[sharedColor].shade30, | ||
| [`colorPalette${color}Foreground2`]: personaSharedColors[sharedColor].tint40, | ||
| [`colorPalette${color}BorderActive`]: personaSharedColors[sharedColor].tint30, | ||
| }; | ||
|
|
||
| return { ...acc, ...sharedColorTokens }; | ||
| }, {} as PersonaColorPaletteTokens); | ||
|
|
||
| export const colorPaletteTokens: ColorPaletteTokens = { ...statusColorPaletteTokens, ...personaColorPaletteTokens }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -848,54 +848,95 @@ const charcoal: ColorVariants = { | |
| tint60: '#f7f7f7', | ||
| }; | ||
|
|
||
| export const sharedColors: GlobalSharedColors = { | ||
| darkRed, | ||
| burgundy, | ||
| cranberry, | ||
| export type StatusSharedColors = 'red' | 'green' | 'darkOrange' | 'yellow' | 'berry'; | ||
|
|
||
| export const statusSharedColors: Pick<GlobalSharedColors, StatusSharedColors> = { | ||
| red, | ||
| green, | ||
| darkOrange, | ||
| bronze, | ||
| yellow, | ||
| berry, | ||
| }; | ||
|
|
||
| export type PersonaSharedColors = | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a follow up task, the internal structure of the file must be refactored and token pipeline updated. |
||
| | 'darkRed' | ||
| | 'cranberry' | ||
| | 'pumpkin' | ||
| | 'peach' | ||
| | 'marigold' | ||
| | 'gold' | ||
| | 'brass' | ||
| | 'brown' | ||
| | 'forest' | ||
| | 'seafoam' | ||
| | 'darkGreen' | ||
| | 'lightTeal' | ||
| | 'teal' | ||
| | 'steel' | ||
| | 'blue' | ||
| | 'royalBlue' | ||
| | 'cornflower' | ||
| | 'navy' | ||
| | 'lavender' | ||
| | 'purple' | ||
| | 'grape' | ||
| | 'lilac' | ||
| | 'pink' | ||
| | 'magenta' | ||
| | 'plum' | ||
| | 'beige' | ||
| | 'mink' | ||
| | 'platinum' | ||
| | 'anchor'; | ||
|
|
||
| export const personaSharedColors: Pick<GlobalSharedColors, PersonaSharedColors> = { | ||
| darkRed, | ||
| cranberry, | ||
| pumpkin, | ||
| orange, | ||
| peach, | ||
| marigold, | ||
| yellow, | ||
| gold, | ||
| brass, | ||
| brown, | ||
| darkBrown, | ||
| lime, | ||
| forest, | ||
| seafoam, | ||
| lightGreen, | ||
| green, | ||
| darkGreen, | ||
| lightTeal, | ||
| teal, | ||
| darkTeal, | ||
| cyan, | ||
| steel, | ||
| lightBlue, | ||
| blue, | ||
| royalBlue, | ||
| darkBlue, | ||
| cornflower, | ||
| navy, | ||
| lavender, | ||
| purple, | ||
| darkPurple, | ||
| orchid, | ||
| grape, | ||
| berry, | ||
| lilac, | ||
| pink, | ||
| hotPink, | ||
| magenta, | ||
| plum, | ||
| beige, | ||
| mink, | ||
| silver, | ||
| platinum, | ||
| anchor, | ||
| }; | ||
|
|
||
| // These shared colors are currently not used in themes | ||
| // Not exported from the package, we can consider removing them | ||
| export const unusedSharedColors: Partial<GlobalSharedColors> = { | ||
| burgundy, | ||
| bronze, | ||
| orange, | ||
| darkBrown, | ||
| lime, | ||
| lightGreen, | ||
| darkTeal, | ||
| cyan, | ||
| lightBlue, | ||
| darkBlue, | ||
| darkPurple, | ||
| orchid, | ||
| hotPink, | ||
| silver, | ||
| charcoal, | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be addressed before merging the PR. Daisy (@daisygeng)