|
| 1 | +import { |
| 2 | + colorsBackgroundDark, |
| 3 | + colorsBackgroundUtility, |
| 4 | + colorsTextIcon, |
| 5 | + layout, |
| 6 | + type, |
| 7 | + colorsGreen, |
| 8 | + colorsYellow, |
| 9 | + colorsBlue, |
| 10 | + colorsRed, |
| 11 | + colorsWhite |
| 12 | +} from '@pluralsight/ps-design-system-core' |
| 13 | +import { names as themeNames } from '@pluralsight/ps-design-system-theme' |
| 14 | + |
| 15 | +import { appearances, colors } from '../vars' |
| 16 | +import { select } from '../js' |
| 17 | + |
| 18 | +export default { |
| 19 | + '.psds-badge': { |
| 20 | + borderRadius: '2px', |
| 21 | + display: 'inline-block', |
| 22 | + fontSize: type.fontSize100, |
| 23 | + letterSpacing: type.letterSpacingAllCaps, |
| 24 | + fontWeight: type.fontWeightStrong, |
| 25 | + lineHeight: type.lineHeightStandard, |
| 26 | + padding: `0 ${layout.spacingXSmall}`, |
| 27 | + textTransform: 'uppercase' |
| 28 | + }, |
| 29 | + |
| 30 | + [select(themeNames.dark, appearances.default, colors.neutral)]: { |
| 31 | + color: colorsTextIcon.highOnLight, |
| 32 | + backgroundColor: colorsWhite |
| 33 | + }, |
| 34 | + [select(themeNames.dark, appearances.default, colors.green)]: { |
| 35 | + color: colorsTextIcon.highOnDark, |
| 36 | + backgroundColor: colorsGreen[8] |
| 37 | + }, |
| 38 | + [select(themeNames.dark, appearances.default, colors.yellow)]: { |
| 39 | + color: colorsTextIcon.highOnLight, |
| 40 | + backgroundColor: colorsYellow[6] |
| 41 | + }, |
| 42 | + [select(themeNames.dark, appearances.default, colors.red)]: { |
| 43 | + color: colorsTextIcon.highOnDark, |
| 44 | + backgroundColor: colorsRed[7] |
| 45 | + }, |
| 46 | + [select(themeNames.dark, appearances.default, colors.blue)]: { |
| 47 | + color: colorsTextIcon.highOnDark, |
| 48 | + backgroundColor: colorsBlue[7] |
| 49 | + }, |
| 50 | + |
| 51 | + [select(themeNames.light, appearances.default, colors.neutral)]: { |
| 52 | + color: colorsTextIcon.highOnDark, |
| 53 | + backgroundColor: colorsBackgroundDark[3] |
| 54 | + }, |
| 55 | + [select(themeNames.light, appearances.default, colors.green)]: { |
| 56 | + color: colorsTextIcon.highOnDark, |
| 57 | + backgroundColor: colorsGreen[8] |
| 58 | + }, |
| 59 | + [select(themeNames.light, appearances.default, colors.yellow)]: { |
| 60 | + color: colorsTextIcon.highOnLight, |
| 61 | + backgroundColor: colorsYellow[6] |
| 62 | + }, |
| 63 | + [select(themeNames.light, appearances.default, colors.red)]: { |
| 64 | + color: colorsTextIcon.highOnDark, |
| 65 | + backgroundColor: colorsRed[7] |
| 66 | + }, |
| 67 | + [select(themeNames.light, appearances.default, colors.blue)]: { |
| 68 | + color: colorsTextIcon.highOnDark, |
| 69 | + backgroundColor: colorsBlue[7] |
| 70 | + }, |
| 71 | + |
| 72 | + [select(themeNames.dark, appearances.subtle, colors.neutral)]: { |
| 73 | + color: colorsTextIcon.lowOnDark, |
| 74 | + backgroundColor: colorsBackgroundUtility[40] |
| 75 | + }, |
| 76 | + [select(themeNames.dark, appearances.subtle, colors.green)]: { |
| 77 | + color: colorsGreen[1], |
| 78 | + backgroundColor: 'rgba(0,143,70,0.5)' |
| 79 | + }, |
| 80 | + [select(themeNames.dark, appearances.subtle, colors.yellow)]: { |
| 81 | + color: colorsYellow[1], |
| 82 | + backgroundColor: 'rgba(226,181,0,0.5)' |
| 83 | + }, |
| 84 | + [select(themeNames.dark, appearances.subtle, colors.red)]: { |
| 85 | + color: colorsRed[1], |
| 86 | + backgroundColor: 'rgba(192,15,0,0.5)' |
| 87 | + }, |
| 88 | + |
| 89 | + [select(themeNames.dark, appearances.subtle, colors.blue)]: { |
| 90 | + color: colorsBlue[1], |
| 91 | + backgroundColor: 'rgba(0,116,171,0.5)' |
| 92 | + }, |
| 93 | + |
| 94 | + [select(themeNames.light, appearances.subtle, colors.neutral)]: { |
| 95 | + color: colorsTextIcon.lowOnLight, |
| 96 | + backgroundColor: colorsBackgroundUtility[20] |
| 97 | + }, |
| 98 | + [select(themeNames.light, appearances.subtle, colors.green)]: { |
| 99 | + color: colorsGreen[10], |
| 100 | + backgroundColor: colorsGreen[1] |
| 101 | + }, |
| 102 | + [select(themeNames.light, appearances.subtle, colors.yellow)]: { |
| 103 | + color: colorsYellow[10], |
| 104 | + backgroundColor: colorsYellow[1] |
| 105 | + }, |
| 106 | + [select(themeNames.light, appearances.subtle, colors.red)]: { |
| 107 | + color: colorsRed[10], |
| 108 | + backgroundColor: colorsRed[1] |
| 109 | + }, |
| 110 | + [select(themeNames.light, appearances.subtle, colors.blue)]: { |
| 111 | + color: colorsBlue[10], |
| 112 | + backgroundColor: colorsBlue[1] |
| 113 | + } |
| 114 | +} |
0 commit comments