Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Screener, { Steps } from 'screener-storybook/src/screener';
const useStyles = makeStyles({
box: {
...shorthands.border('5px', 'solid', tokens.colorNeutralStroke1),
...shorthands.borderLeft('20px', 'solid', tokens.colorPaletteBlueBorder2),
...shorthands.borderLeft('20px', 'solid', tokens.colorPaletteDarkOrangeBorder2),

backgroundColor: tokens.colorNeutralBackground1,
color: tokens.colorNeutralForeground1,
Expand All @@ -20,7 +20,7 @@ const useStyles = makeStyles({

container: {
...shorthands.border('5px', 'solid', tokens.colorNeutralStroke1),
...shorthands.borderLeft('20px', 'solid', tokens.colorPaletteBlueBorder2),
...shorthands.borderLeft('20px', 'solid', tokens.colorPaletteDarkOrangeBorder2),

...shorthands.margin('5px'),
...shorthands.padding('5px'),
Expand Down
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"
}
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"
}
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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ const useStyles = makeStyles({
color: tokens.colorPaletteRedBackground3,
},
statusAway: {
color: tokens.colorPaletteMarigoldBackground3,
color: tokens.colorPaletteYellowBackground3, // FIXME: Badge specs uses Marigold for Away

Copy link
Copy Markdown
Member Author

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)

},
statusAvailable: {
color: tokens.colorPaletteLightGreenForeground3,
color: tokens.colorPaletteGreenForeground3, // FIXME: Badge spec uses LightGreen for Available
},
statusOffline: {
color: tokens.colorNeutralForeground3,
Expand All @@ -50,13 +50,13 @@ const useStyles = makeStyles({
color: tokens.colorNeutralBackground1,
},
outOfOfficeAvailable: {
color: tokens.colorPaletteLightGreenForeground3,
color: tokens.colorPaletteGreenForeground3, // FIXME: Badge spec uses LightGreen for Available
},
outOfOfficeBusy: {
color: tokens.colorPaletteRedBackground3,
},
outOfOfficeAway: {
color: tokens.colorPaletteMarigoldBackground3,
color: tokens.colorPaletteYellowBackground3, // FIXME: Badge specs uses Marigold for Away
},

// Icons are not resizeable, and these sizes are currently missing
Expand Down

Large diffs are not rendered by default.

90 changes: 45 additions & 45 deletions packages/react-components/react-theme/etc/react-theme.api.md

Large diffs are not rendered by default.

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 };
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { hcHighlight, white, black, sharedColors } from '../global/colors';
import { ColorPaletteTokens, GlobalSharedColors } from '../types';
import {
statusSharedColors,
personaSharedColors,
hcHighlight,
white,
black,
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 = {
Expand All @@ -18,4 +26,19 @@ export const colorPaletteTokens: ColorPaletteTokens = (Object.keys(sharedColors)
};

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`]: black,
[`colorPalette${color}Foreground2`]: white,
[`colorPalette${color}BorderActive`]: hcHighlight,
};

return { ...acc, ...sharedColorTokens };
}, {} as PersonaColorPaletteTokens);

export const colorPaletteTokens: ColorPaletteTokens = { ...statusColorPaletteTokens, ...personaColorPaletteTokens };
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 };
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 };
81 changes: 61 additions & 20 deletions packages/react-components/react-theme/src/global/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =

Copy link
Copy Markdown
Member Author

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.

| '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,
};
Loading