about summary refs log tree commit diff
path: root/src/alf/themes.ts
blob: aae5c58931c0b23c5c1cce7dd4bfe03ea9e4dddb (plain) (blame)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import * as tokens from '#/alf/tokens'
import type {Mutable} from '#/alf/types'

export type ThemeName = 'light' | 'dark'
export type ReadonlyTheme = typeof light
export type Theme = Mutable<ReadonlyTheme>

export type Palette = {
  primary: string
  positive: string
  negative: string
}

export const lightPalette: Palette = {
  primary: tokens.color.blue_500,
  positive: tokens.color.green_500,
  negative: tokens.color.red_500,
} as const

export const darkPalette: Palette = {
  primary: tokens.color.blue_500,
  positive: tokens.color.green_400,
  negative: tokens.color.red_400,
} as const

export const light = {
  palette: lightPalette,
  atoms: {
    text: {
      color: tokens.color.gray_1000,
    },
    text_contrast_700: {
      color: tokens.color.gray_700,
    },
    text_contrast_500: {
      color: tokens.color.gray_500,
    },
    text_inverted: {
      color: tokens.color.white,
    },
    bg: {
      backgroundColor: tokens.color.white,
    },
    bg_contrast_100: {
      backgroundColor: tokens.color.gray_100,
    },
    bg_contrast_200: {
      backgroundColor: tokens.color.gray_200,
    },
    bg_contrast_300: {
      backgroundColor: tokens.color.gray_300,
    },
    bg_positive: {
      backgroundColor: tokens.color.green_500,
    },
    bg_negative: {
      backgroundColor: tokens.color.red_400,
    },
    border: {
      borderColor: tokens.color.gray_200,
    },
    border_contrast_500: {
      borderColor: tokens.color.gray_500,
    },
  },
}

export const dark: Theme = {
  palette: darkPalette,
  atoms: {
    text: {
      color: tokens.color.white,
    },
    text_contrast_700: {
      color: tokens.color.gray_300,
    },
    text_contrast_500: {
      color: tokens.color.gray_500,
    },
    text_inverted: {
      color: tokens.color.gray_1000,
    },
    bg: {
      backgroundColor: tokens.color.gray_1000,
    },
    bg_contrast_100: {
      backgroundColor: tokens.color.gray_900,
    },
    bg_contrast_200: {
      backgroundColor: tokens.color.gray_800,
    },
    bg_contrast_300: {
      backgroundColor: tokens.color.gray_700,
    },
    bg_positive: {
      backgroundColor: tokens.color.green_400,
    },
    bg_negative: {
      backgroundColor: tokens.color.red_400,
    },
    border: {
      borderColor: tokens.color.gray_800,
    },
    border_contrast_500: {
      borderColor: tokens.color.gray_500,
    },
  },
}