-
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
BREAKING: reduce shared colors #23578
Conversation
📊 Bundle size reportUnchanged fixtures
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 2705ee9c84dea54369d2b10f3c19bf57c957aeeb (build) |
| }, | ||
| statusAway: { | ||
| color: tokens.colorPaletteMarigoldBackground3, | ||
| color: tokens.colorPaletteYellowBackground3, // FIXME: Badge specs uses Marigold for Away |
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. @daisygeng
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 9d9ff45:
|
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 1723 | 1681 | 5000 | |
| Button | mount | 1323 | 1284 | 5000 | |
| FluentProvider | mount | 2800 | 2289 | 5000 | |
| FluentProviderWithTheme | mount | 971 | 885 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 898 | 849 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 957 | 900 | 10 | |
| MakeStyles | mount | 2514 | 2524 | 50000 |
| berry, | ||
| }; | ||
|
|
||
| export type PersonaSharedColors = |
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.
As a follow up task, the internal structure of the file must be refactored and token pipeline updated.
Complete list of 309 removed tokensClick to expand!colorPaletteAnchorBackground1
colorPaletteAnchorBackground3
colorPaletteAnchorBorder1
colorPaletteAnchorBorder2
colorPaletteAnchorForeground1
colorPaletteAnchorForeground3
colorPaletteBeigeBackground1
colorPaletteBeigeBackground3
colorPaletteBeigeBorder1
colorPaletteBeigeBorder2
colorPaletteBeigeForeground1
colorPaletteBeigeForeground3
colorPaletteBlueBackground1
colorPaletteBlueBackground3
colorPaletteBlueBorder1
colorPaletteBlueBorder2
colorPaletteBlueForeground1
colorPaletteBlueForeground3
colorPaletteBrassBackground1
colorPaletteBrassBackground3
colorPaletteBrassBorder1
colorPaletteBrassBorder2
colorPaletteBrassForeground1
colorPaletteBrassForeground3
colorPaletteBronzeBackground1
colorPaletteBronzeBackground2
colorPaletteBronzeBackground3
colorPaletteBronzeBorder1
colorPaletteBronzeBorder2
colorPaletteBronzeBorderActive
colorPaletteBronzeForeground1
colorPaletteBronzeForeground2
colorPaletteBronzeForeground3
colorPaletteBrownBackground1
colorPaletteBrownBackground3
colorPaletteBrownBorder1
colorPaletteBrownBorder2
colorPaletteBrownForeground1
colorPaletteBrownForeground3
colorPaletteBurgundyBackground1
colorPaletteBurgundyBackground2
colorPaletteBurgundyBackground3
colorPaletteBurgundyBorder1
colorPaletteBurgundyBorder2
colorPaletteBurgundyBorderActive
colorPaletteBurgundyForeground1
colorPaletteBurgundyForeground2
colorPaletteBurgundyForeground3
colorPaletteCharcoalBackground1
colorPaletteCharcoalBackground2
colorPaletteCharcoalBackground3
colorPaletteCharcoalBorder1
colorPaletteCharcoalBorder2
colorPaletteCharcoalBorderActive
colorPaletteCharcoalForeground1
colorPaletteCharcoalForeground2
colorPaletteCharcoalForeground3
colorPaletteCornflowerBackground1
colorPaletteCornflowerBackground3
colorPaletteCornflowerBorder1
colorPaletteCornflowerBorder2
colorPaletteCornflowerForeground1
colorPaletteCornflowerForeground3
colorPaletteCranberryBackground1
colorPaletteCranberryBackground3
colorPaletteCranberryBorder1
colorPaletteCranberryBorder2
colorPaletteCranberryForeground1
colorPaletteCranberryForeground3
colorPaletteCyanBackground1
colorPaletteCyanBackground2
colorPaletteCyanBackground3
colorPaletteCyanBorder1
colorPaletteCyanBorder2
colorPaletteCyanBorderActive
colorPaletteCyanForeground1
colorPaletteCyanForeground2
colorPaletteCyanForeground3
colorPaletteDarkBlueBackground1
colorPaletteDarkBlueBackground2
colorPaletteDarkBlueBackground3
colorPaletteDarkBlueBorder1
colorPaletteDarkBlueBorder2
colorPaletteDarkBlueBorderActive
colorPaletteDarkBlueForeground1
colorPaletteDarkBlueForeground2
colorPaletteDarkBlueForeground3
colorPaletteDarkBrownBackground1
colorPaletteDarkBrownBackground2
colorPaletteDarkBrownBackground3
colorPaletteDarkBrownBorder1
colorPaletteDarkBrownBorder2
colorPaletteDarkBrownBorderActive
colorPaletteDarkBrownForeground1
colorPaletteDarkBrownForeground2
colorPaletteDarkBrownForeground3
colorPaletteDarkGreenBackground1
colorPaletteDarkGreenBackground3
colorPaletteDarkGreenBorder1
colorPaletteDarkGreenBorder2
colorPaletteDarkGreenForeground1
colorPaletteDarkGreenForeground3
colorPaletteDarkPurpleBackground1
colorPaletteDarkPurpleBackground2
colorPaletteDarkPurpleBackground3
colorPaletteDarkPurpleBorder1
colorPaletteDarkPurpleBorder2
colorPaletteDarkPurpleBorderActive
colorPaletteDarkPurpleForeground1
colorPaletteDarkPurpleForeground2
colorPaletteDarkPurpleForeground3
colorPaletteDarkRedBackground1
colorPaletteDarkRedBackground3
colorPaletteDarkRedBorder1
colorPaletteDarkRedBorder2
colorPaletteDarkRedForeground1
colorPaletteDarkRedForeground3
colorPaletteDarkTealBackground1
colorPaletteDarkTealBackground2
colorPaletteDarkTealBackground3
colorPaletteDarkTealBorder1
colorPaletteDarkTealBorder2
colorPaletteDarkTealBorderActive
colorPaletteDarkTealForeground1
colorPaletteDarkTealForeground2
colorPaletteDarkTealForeground3
colorPaletteForestBackground1
colorPaletteForestBackground3
colorPaletteForestBorder1
colorPaletteForestBorder2
colorPaletteForestForeground1
colorPaletteForestForeground3
colorPaletteGoldBackground1
colorPaletteGoldBackground3
colorPaletteGoldBorder1
colorPaletteGoldBorder2
colorPaletteGoldForeground1
colorPaletteGoldForeground3
colorPaletteGrapeBackground1
colorPaletteGrapeBackground3
colorPaletteGrapeBorder1
colorPaletteGrapeBorder2
colorPaletteGrapeForeground1
colorPaletteGrapeForeground3
colorPaletteHotPinkBackground1
colorPaletteHotPinkBackground2
colorPaletteHotPinkBackground3
colorPaletteHotPinkBorder1
colorPaletteHotPinkBorder2
colorPaletteHotPinkBorderActive
colorPaletteHotPinkForeground1
colorPaletteHotPinkForeground2
colorPaletteHotPinkForeground3
colorPaletteLavenderBackground1
colorPaletteLavenderBackground3
colorPaletteLavenderBorder1
colorPaletteLavenderBorder2
colorPaletteLavenderForeground1
colorPaletteLavenderForeground3
colorPaletteLightBlueBackground1
colorPaletteLightBlueBackground2
colorPaletteLightBlueBackground3
colorPaletteLightBlueBorder1
colorPaletteLightBlueBorder2
colorPaletteLightBlueBorderActive
colorPaletteLightBlueForeground1
colorPaletteLightBlueForeground2
colorPaletteLightBlueForeground3
colorPaletteLightGreenBackground1
colorPaletteLightGreenBackground2
colorPaletteLightGreenBackground3
colorPaletteLightGreenBorder1
colorPaletteLightGreenBorder2
colorPaletteLightGreenBorderActive
colorPaletteLightGreenForeground1
colorPaletteLightGreenForeground2
colorPaletteLightGreenForeground3
colorPaletteLightTealBackground1
colorPaletteLightTealBackground3
colorPaletteLightTealBorder1
colorPaletteLightTealBorder2
colorPaletteLightTealForeground1
colorPaletteLightTealForeground3
colorPaletteLilacBackground1
colorPaletteLilacBackground3
colorPaletteLilacBorder1
colorPaletteLilacBorder2
colorPaletteLilacForeground1
colorPaletteLilacForeground3
colorPaletteLimeBackground1
colorPaletteLimeBackground2
colorPaletteLimeBackground3
colorPaletteLimeBorder1
colorPaletteLimeBorder2
colorPaletteLimeBorderActive
colorPaletteLimeForeground1
colorPaletteLimeForeground2
colorPaletteLimeForeground3
colorPaletteMagentaBackground1
colorPaletteMagentaBackground3
colorPaletteMagentaBorder1
colorPaletteMagentaBorder2
colorPaletteMagentaForeground1
colorPaletteMagentaForeground3
colorPaletteMarigoldBackground1
colorPaletteMarigoldBackground3
colorPaletteMarigoldBorder1
colorPaletteMarigoldBorder2
colorPaletteMarigoldForeground1
colorPaletteMarigoldForeground3
colorPaletteMinkBackground1
colorPaletteMinkBackground3
colorPaletteMinkBorder1
colorPaletteMinkBorder2
colorPaletteMinkForeground1
colorPaletteMinkForeground3
colorPaletteNavyBackground1
colorPaletteNavyBackground3
colorPaletteNavyBorder1
colorPaletteNavyBorder2
colorPaletteNavyForeground1
colorPaletteNavyForeground3
colorPaletteOrangeBackground1
colorPaletteOrangeBackground2
colorPaletteOrangeBackground3
colorPaletteOrangeBorder1
colorPaletteOrangeBorder2
colorPaletteOrangeBorderActive
colorPaletteOrangeForeground1
colorPaletteOrangeForeground2
colorPaletteOrangeForeground3
colorPaletteOrchidBackground1
colorPaletteOrchidBackground2
colorPaletteOrchidBackground3
colorPaletteOrchidBorder1
colorPaletteOrchidBorder2
colorPaletteOrchidBorderActive
colorPaletteOrchidForeground1
colorPaletteOrchidForeground2
colorPaletteOrchidForeground3
colorPalettePeachBackground1
colorPalettePeachBackground3
colorPalettePeachBorder1
colorPalettePeachBorder2
colorPalettePeachForeground1
colorPalettePeachForeground3
colorPalettePinkBackground1
colorPalettePinkBackground3
colorPalettePinkBorder1
colorPalettePinkBorder2
colorPalettePinkForeground1
colorPalettePinkForeground3
colorPalettePlatinumBackground1
colorPalettePlatinumBackground3
colorPalettePlatinumBorder1
colorPalettePlatinumBorder2
colorPalettePlatinumForeground1
colorPalettePlatinumForeground3
colorPalettePlumBackground1
colorPalettePlumBackground3
colorPalettePlumBorder1
colorPalettePlumBorder2
colorPalettePlumForeground1
colorPalettePlumForeground3
colorPalettePumpkinBackground1
colorPalettePumpkinBackground3
colorPalettePumpkinBorder1
colorPalettePumpkinBorder2
colorPalettePumpkinForeground1
colorPalettePumpkinForeground3
colorPalettePurpleBackground1
colorPalettePurpleBackground3
colorPalettePurpleBorder1
colorPalettePurpleBorder2
colorPalettePurpleForeground1
colorPalettePurpleForeground3
colorPaletteRoyalBlueBackground1
colorPaletteRoyalBlueBackground3
colorPaletteRoyalBlueBorder1
colorPaletteRoyalBlueBorder2
colorPaletteRoyalBlueForeground1
colorPaletteRoyalBlueForeground3
colorPaletteSeafoamBackground1
colorPaletteSeafoamBackground3
colorPaletteSeafoamBorder1
colorPaletteSeafoamBorder2
colorPaletteSeafoamForeground1
colorPaletteSeafoamForeground3
colorPaletteSilverBackground1
colorPaletteSilverBackground2
colorPaletteSilverBackground3
colorPaletteSilverBorder1
colorPaletteSilverBorder2
colorPaletteSilverBorderActive
colorPaletteSilverForeground1
colorPaletteSilverForeground2
colorPaletteSilverForeground3
colorPaletteSteelBackground1
colorPaletteSteelBackground3
colorPaletteSteelBorder1
colorPaletteSteelBorder2
colorPaletteSteelForeground1
colorPaletteSteelForeground3
colorPaletteTealBackground1
colorPaletteTealBackground3
colorPaletteTealBorder1
colorPaletteTealBorder2
colorPaletteTealForeground1
colorPaletteTealForeground3 |
|
Closing, replaced by a proper PR to 9.0-rc branch: #23608. |
Fixed in cd18a12 |


Implements RFC #23537 to demonstrate the impact of reducing shared color tokens in react-theme.
Motivation
As described in the RFC, the main motivation is FUI rendering perf. Number of tokens which are represented by CSS variables has linear impact on rendering performance.
This PR reduces the theme from 669 to 360 tokens. FIXME
Fair note - we might have to re-add some of the tokens later as required by different components and experiences, but (1) before doing so, will will explore different possible optimizations as described in the RFC and (2) we will be adding only the tokens really needed.
Status shared colors - with no changes
There are 7 shared colors used for error and status:
There is NO change for these colors, there will still be the same 9 alias color tokens as before:
Persona shared colors - 6 tokens per color removed
There are 28 shared colors used for Persona:
The tokens for these colors are reduced to 3 tokens per color:
NOTE: There are actually 30 colors used in Persona, the 2 remaining ones are
RedandMarigoldwhich are already included in Status Shared Colors.Unused shared colors - removed completely
There have been 14 another shared colors in the theme which are neither status nor persona colors - those will be removed completely: