-
-
Notifications
You must be signed in to change notification settings - Fork 314
/
index.ts
132 lines (124 loc) · 3.95 KB
/
index.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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import crimson from './crimson.js';
import goldNouveau from './gold-nouveau.js';
import hamlindigo from './hamlindigo.js';
import modern from './modern.js';
import rocket from './rocket.js';
import sahara from './sahara.js';
import seafoam from './seafoam.js';
import skeleton from './skeleton.js';
import vintage from './vintage.js';
import wintry from './wintry.js';
import type { CSSRuleObject } from 'tailwindcss/types/config.js';
export const themes = { crimson, 'gold-nouveau': goldNouveau, hamlindigo, modern, rocket, sahara, seafoam, skeleton, vintage, wintry };
export type PresetThemeName = ObjectKeys<typeof themes>;
export function getThemeProperties(themeName: PresetThemeName) {
return themes[themeName].properties;
}
export type ObjectValues<T> = T[keyof T];
export type ObjectKeys<T> = keyof T;
/* Allows for arbitrary properties to be defined */
type ArbitraryProps = Record<string, string>;
export type BaseTheme = {
name: string;
properties: ThemeProperties & ArbitraryProps;
properties_dark: Partial<ThemeProperties & ArbitraryProps>;
};
export type PresetTheme = BaseTheme & {
enhancements: CSSRuleObject;
};
export type ThemeProperties = {
/* =~= Theme Properties =~= */
'--theme-font-family-base': string;
'--theme-font-family-heading': string;
'--theme-font-color-base': string;
'--theme-font-color-dark': string;
'--theme-rounded-base': string;
'--theme-rounded-container': string;
'--theme-border-base': string;
/* =~= Theme On-X Colors =~= */
'--on-primary': string;
'--on-secondary': string;
'--on-tertiary': string;
'--on-success': string;
'--on-warning': string;
'--on-error': string;
'--on-surface': string;
/* =~= Theme Colors =~= */
/* primary */
'--color-primary-50': string;
'--color-primary-100': string;
'--color-primary-200': string;
'--color-primary-300': string;
'--color-primary-400': string;
'--color-primary-500': string;
'--color-primary-600': string;
'--color-primary-700': string;
'--color-primary-800': string;
'--color-primary-900': string;
/* secondary */
'--color-secondary-50': string;
'--color-secondary-100': string;
'--color-secondary-200': string;
'--color-secondary-300': string;
'--color-secondary-400': string;
'--color-secondary-500': string;
'--color-secondary-600': string;
'--color-secondary-700': string;
'--color-secondary-800': string;
'--color-secondary-900': string;
/* tertiary */
'--color-tertiary-50': string;
'--color-tertiary-100': string;
'--color-tertiary-200': string;
'--color-tertiary-300': string;
'--color-tertiary-400': string;
'--color-tertiary-500': string;
'--color-tertiary-600': string;
'--color-tertiary-700': string;
'--color-tertiary-800': string;
'--color-tertiary-900': string;
/* success */
'--color-success-50': string;
'--color-success-100': string;
'--color-success-200': string;
'--color-success-300': string;
'--color-success-400': string;
'--color-success-500': string;
'--color-success-600': string;
'--color-success-700': string;
'--color-success-800': string;
'--color-success-900': string;
/* warning */
'--color-warning-50': string;
'--color-warning-100': string;
'--color-warning-200': string;
'--color-warning-300': string;
'--color-warning-400': string;
'--color-warning-500': string;
'--color-warning-600': string;
'--color-warning-700': string;
'--color-warning-800': string;
'--color-warning-900': string;
/* error */
'--color-error-50': string;
'--color-error-100': string;
'--color-error-200': string;
'--color-error-300': string;
'--color-error-400': string;
'--color-error-500': string;
'--color-error-600': string;
'--color-error-700': string;
'--color-error-800': string;
'--color-error-900': string;
/* surface */
'--color-surface-50': string;
'--color-surface-100': string;
'--color-surface-200': string;
'--color-surface-300': string;
'--color-surface-400': string;
'--color-surface-500': string;
'--color-surface-600': string;
'--color-surface-700': string;
'--color-surface-800': string;
'--color-surface-900': string;
};