-
Notifications
You must be signed in to change notification settings - Fork 163
/
createAliasesFromPalette.ts
69 lines (59 loc) · 3.05 KB
/
createAliasesFromPalette.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import type { AliasColorTokens, OfficePalette } from '@fluentui-react-native/theme-types';
export function createAliasesFromPalette(palette: OfficePalette, isHighContrast: boolean): Partial<AliasColorTokens> {
// Workaround for getting checkmark to have correct color in HC
// while native code doesn't support PlatformColor
if (isHighContrast) {
return {};
}
return {
neutralForeground1: palette.Text,
neutralForeground1Hover: palette.TextHover,
neutralForeground1Pressed: palette.TextPressed,
neutralForeground1Selected: palette.TextSelected,
neutralForeground2: palette.TextSecondary,
neutralForeground2Hover: palette.TextSecondaryHover,
neutralForeground2Pressed: palette.TextSecondaryPressed,
neutralForeground2Selected: palette.TextSecondarySelected,
neutralForeground4: palette.TextCtlSubtlePlaceholder,
neutralForegroundDisabled: palette.TextDisabled,
compoundBrandForeground1: palette.TextEmphasis,
compoundBrandForeground1Hover: palette.TextEmphasisHover,
compoundBrandForeground1Pressed: palette.TextEmphasisPressed,
neutralForegroundInverted: palette.TextCtlSubtleSelectionHighlight,
neutralForegroundOnBrand: palette.TextCtlEmphasis,
neutralForegroundOnBrandHover: palette.TextCtlEmphasisHover,
neutralForegroundOnBrandPressed: palette.TextCtlEmphasisPressed,
neutralForegroundInvertedLink: palette.BkgToggleSwitchOff,
neutralForegroundInvertedLinkHover: palette.BkgToggleSwitchOffHover,
neutralForegroundInvertedLinkPressed: palette.BkgToggleSwitchOffPressed,
neutralBackground1: palette.Bkg,
neutralBackground1Hover: palette.BkgHover,
neutralBackground1Pressed: palette.BkgPressed,
neutralBackground1Selected: palette.BkgSelected,
neutralBackground2: palette.BkgHeader,
neutralBackground2Hover: palette.BkgSubtle,
neutralBackground3: palette.BkgSubtle,
neutralBackgroundInverted: palette.BkgSelectionHighlight,
neutralBackgroundDisabled: palette.BkgCtlDisabled,
neutralStencil1: palette.SliderBuffer,
brandBackground: palette.BkgCtlEmphasis,
brandBackgroundHover: palette.BkgCtlEmphasisHover,
brandBackgroundPressed: palette.BkgCtlEmphasisPressed,
compoundBrandBackground1: palette.BkgToggleSwitchOn,
compoundBrandBackground1Hover: palette.BkgToggleSwitchOnHover,
compoundBrandBackground1Pressed: palette.BkgToggleSwitchOnPressed,
neutralStrokeAccessible: palette.StrokeOnlySelected,
neutralStrokeAccessibleHover: palette.StrokeOnlyHover,
neutralStrokeAccessiblePressed: palette.StrokeOnlyPressed,
neutralStroke1: palette.StrokeCtl,
neutralStroke1Hover: palette.StrokeSelectedHover,
neutralStroke1Pressed: palette.StrokeOverPressed,
neutralStroke2: palette.SliderBuffer,
brandStroke1: palette.AccentEmphasis,
compoundBrandStroke1: palette.StrokeToggleSwitchOn,
compoundBrandStroke1Hover: palette.StrokeToggleSwitchOnHover,
compoundBrandStroke1Pressed: palette.StrokeToggleSwitchOnPressed,
neutralStrokeDisabled: palette.StrokeCtlDisabled,
strokeFocus2: palette.StrokeKeyboard,
};
}