Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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.colorPaletteBerryBorder2),

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.colorPaletteBerryBorder2),

...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": "BREAKING: reduce shared colors",
"packageName": "@fluentui/react-theme",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ const useStyles = makeStyles({
},
// filledLighter and filledDarker appearances depend on particular background colors
filledLighter: {
backgroundColor: tokens.colorPaletteDarkBlueForeground1,
backgroundColor: tokens.colorPaletteBerryForeground1,
'> label': {
color: tokens.colorNeutralForegroundInverted,
},
},
filledDarker: {
backgroundColor: tokens.colorPaletteDarkBlueForeground1,
backgroundColor: tokens.colorPaletteBerryForeground1,
'> label': {
color: tokens.colorNeutralForegroundInverted,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ const useStyles = makeStyles({
...shorthands.padding(tokens.spacingHorizontalMNudge),
},
filledLighter: {
backgroundColor: tokens.colorPaletteDarkBlueForeground1,
backgroundColor: tokens.colorPaletteBerryForeground1,
'> label': {
color: tokens.colorNeutralForegroundInverted,
},
},
filledDarker: {
backgroundColor: tokens.colorPaletteDarkBlueForeground1,
backgroundColor: tokens.colorPaletteBerryForeground1,
'> label': {
color: tokens.colorNeutralForegroundInverted,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ const useStyles = makeStyles({
},

filledLighter: {
backgroundColor: tokens.colorPaletteDarkBlueForeground1,
backgroundColor: tokens.colorPaletteBerryForeground1,
'> label': {
color: tokens.colorNeutralForegroundInverted,
},
},
filledDarker: {
backgroundColor: tokens.colorPaletteDarkBlueForeground1,
backgroundColor: tokens.colorPaletteBerryForeground1,
'> label': {
color: tokens.colorNeutralForegroundInverted,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ const useStyles = makeStyles({
},

filledLighter: {
backgroundColor: tokens.colorPaletteDarkBlueForeground1,
backgroundColor: tokens.colorPaletteBerryForeground1,
'> label': {
color: tokens.colorNeutralForegroundInverted,
},
},
filledDarker: {
backgroundColor: tokens.colorPaletteDarkBlueForeground1,
backgroundColor: tokens.colorPaletteBerryForeground1,
'> label': {
color: tokens.colorNeutralForegroundInverted,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ const useStyles = makeStyles({
},
},
filledLighter: {
backgroundColor: tokens.colorPaletteDarkBlueForeground1,
backgroundColor: tokens.colorPaletteBerryForeground1,
'> label': {
color: tokens.colorNeutralForegroundInverted,
},
},
filledDarker: {
backgroundColor: tokens.colorPaletteDarkBlueForeground1,
backgroundColor: tokens.colorPaletteBerryForeground1,
'> label': {
color: tokens.colorNeutralForegroundInverted,
},
Expand Down
100 changes: 29 additions & 71 deletions packages/react-components/react-theme/etc/react-theme.api.md

Large diffs are not rendered by default.

43 changes: 29 additions & 14 deletions packages/react-components/react-theme/src/alias/darkColorPalette.ts
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 };
Loading