@qlover/tailwind-theme 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,52 @@
1
+ import { Plugin } from 'postcss';
2
+
3
+ type RGBChannels = string;
4
+ type ColorValue = string;
5
+ type ThemeTokens = Record<string, ColorValue | RGBChannels>;
6
+ /** Named themes → token sets (avoids index-signature confusion with `Record<string, ThemeTokens>`) */
7
+ type ThemesMap = Record<string, ThemeTokens>;
8
+ /**
9
+ * Token mapping for the theme.
10
+ *
11
+ * @example
12
+ * {
13
+ * 'color-primary': 'rgb(var(--${prefix}-color-primary))',
14
+ * 'color-secondary': 'rgb(var(--${prefix}-color-secondary))',
15
+ * 'color-elevated': 'rgb(var(--${prefix}-color-elevated))',
16
+ * 'color-primary-text': 'rgb(var(--${prefix}-color-primary-text))',
17
+ * 'color-primary-text-hover': 'rgb(var(--${prefix}-color-primary-text-hover))',
18
+ * 'color-secondary-text': 'rgb(var(--${prefix}-color-secondary-text))',
19
+ * 'color-tertiary-text': 'rgb(var(--${prefix}-color-tertiary-text))',
20
+ * }
21
+ *
22
+ * 最后结果可能=>
23
+ * {
24
+ * '--color-primary': 'rgb(var(--fe-color-primary))',
25
+ * '--color-secondary': 'rgb(var(--fe-color-secondary))',
26
+ * '--color-elevated': 'rgb(var(--fe-color-elevated))',
27
+ * '--color-primary-text': 'rgb(var(--fe-color-primary-text))',
28
+ * '--color-primary-text-hover': 'rgb(var(--fe-color-primary-text-hover))',
29
+ * '--color-secondary-text': 'rgb(var(--fe-color-secondary-text))',
30
+ * '--color-tertiary-text': 'rgb(var(--fe-color-tertiary-text))',
31
+ * }
32
+ */
33
+ type TokenMapping = Record<string, string>;
34
+ interface UiThemeOptions {
35
+ prefix?: string;
36
+ defaultTheme?: string;
37
+ themes?: ThemesMap;
38
+ tokenMapping?: TokenMapping;
39
+ cssSelector?: (themeName: string, root: boolean) => string;
40
+ outputPath?: string;
41
+ overwrite?: boolean;
42
+ }
43
+
44
+ interface ThemePluginOptions extends UiThemeOptions {
45
+ includePaths?: string[];
46
+ }
47
+ declare const themePlugin: {
48
+ (userOptions?: ThemePluginOptions): Plugin;
49
+ postcss: boolean;
50
+ };
51
+
52
+ export { type ThemePluginOptions, themePlugin as default };
package/dist/plugin.js ADDED
@@ -0,0 +1,273 @@
1
+ // src/utils.ts
2
+ function resolveTokenValue(value, prefix) {
3
+ return value.replace(/\$\{prefix\}/g, prefix);
4
+ }
5
+ function deepMerge(target, source) {
6
+ const result = { ...target };
7
+ for (const key in source) {
8
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
9
+ const sourceVal = source[key];
10
+ const targetVal = result[key];
11
+ if (sourceVal && typeof sourceVal === "object" && !Array.isArray(sourceVal) && targetVal && typeof targetVal === "object") {
12
+ result[key] = deepMerge(
13
+ targetVal,
14
+ sourceVal
15
+ );
16
+ } else {
17
+ result[key] = sourceVal;
18
+ }
19
+ }
20
+ }
21
+ return result;
22
+ }
23
+
24
+ // src/config.ts
25
+ var themePrimaryBgOpacity = {
26
+ light: "0.08",
27
+ dark: "0.12",
28
+ pink: "0.12",
29
+ amber: "0.12",
30
+ forest: "0.1",
31
+ ocean: "0.1"
32
+ };
33
+ var builtinThemes = {
34
+ light: {
35
+ "color-primary": "246 248 250",
36
+ "color-secondary": "255 255 255",
37
+ "color-elevated": "240 242 244",
38
+ "color-primary-text": "31 35 40",
39
+ "color-primary-text-hover": "101 109 118",
40
+ "color-secondary-text": "101 109 118",
41
+ "color-tertiary-text": "140 149 159",
42
+ "color-primary-border": "208 215 222",
43
+ "color-brand": "124 58 237",
44
+ "color-brand-hover": "109 40 217",
45
+ "color-brand-active": "91 33 182",
46
+ "color-success": "#1a7f37",
47
+ "color-warning": "#faad14",
48
+ "color-error": "#cf222e",
49
+ "border-radius": "6px"
50
+ },
51
+ dark: {
52
+ "color-primary": "15 17 21",
53
+ "color-secondary": "22 27 34",
54
+ "color-elevated": "33 38 45",
55
+ "color-primary-text": "230 237 243",
56
+ "color-primary-text-hover": "139 148 158",
57
+ "color-secondary-text": "139 148 158",
58
+ "color-tertiary-text": "110 118 129",
59
+ "color-primary-border": "48 54 61",
60
+ "color-brand": "139 92 246",
61
+ "color-brand-hover": "124 58 237",
62
+ "color-brand-active": "109 40 217",
63
+ "color-success": "#3fb950",
64
+ "color-warning": "#faad14",
65
+ "color-error": "#f85149",
66
+ "border-radius": "6px"
67
+ },
68
+ pink: {
69
+ "color-primary": "26 13 20",
70
+ "color-secondary": "37 16 27",
71
+ "color-elevated": "48 21 34",
72
+ "color-primary-text": "252 232 240",
73
+ "color-primary-text-hover": "196 144 168",
74
+ "color-secondary-text": "196 144 168",
75
+ "color-tertiary-text": "138 88 112",
76
+ "color-primary-border": "92 45 66",
77
+ "color-brand": "244 114 182",
78
+ "color-brand-hover": "236 72 153",
79
+ "color-brand-active": "219 39 119",
80
+ "color-success": "#34d399",
81
+ "color-warning": "#faad14",
82
+ "color-error": "#fb7185",
83
+ "border-radius": "8px"
84
+ },
85
+ amber: {
86
+ "color-primary": "30 18 0",
87
+ "color-secondary": "40 26 0",
88
+ "color-elevated": "50 31 0",
89
+ "color-primary-text": "242 232 213",
90
+ "color-primary-text-hover": "184 166 138",
91
+ "color-secondary-text": "184 166 138",
92
+ "color-tertiary-text": "122 106 86",
93
+ "color-primary-border": "74 56 0",
94
+ "color-brand": "232 148 58",
95
+ "color-brand-hover": "208 120 40",
96
+ "color-brand-active": "180 100 30",
97
+ "color-success": "#5aad6e",
98
+ "color-warning": "#faad14",
99
+ "color-error": "#c85a4a",
100
+ "border-radius": "6px"
101
+ },
102
+ forest: {
103
+ "color-primary": "6 21 8",
104
+ "color-secondary": "12 31 14",
105
+ "color-elevated": "19 39 22",
106
+ "color-primary-text": "216 240 220",
107
+ "color-primary-text-hover": "136 173 142",
108
+ "color-secondary-text": "136 173 142",
109
+ "color-tertiary-text": "90 122 94",
110
+ "color-primary-border": "44 66 48",
111
+ "color-brand": "74 222 128",
112
+ "color-brand-hover": "34 197 94",
113
+ "color-brand-active": "22 163 74",
114
+ "color-success": "#86efac",
115
+ "color-warning": "#faad14",
116
+ "color-error": "#f87171",
117
+ "border-radius": "6px"
118
+ },
119
+ ocean: {
120
+ "color-primary": "6 14 26",
121
+ "color-secondary": "13 26 46",
122
+ "color-elevated": "18 36 62",
123
+ "color-primary-text": "218 238 255",
124
+ "color-primary-text-hover": "122 181 212",
125
+ "color-secondary-text": "122 181 212",
126
+ "color-tertiary-text": "74 126 154",
127
+ "color-primary-border": "30 58 92",
128
+ "color-brand": "56 189 248",
129
+ "color-brand-hover": "14 165 233",
130
+ "color-brand-active": "2 132 199",
131
+ "color-success": "#34d399",
132
+ "color-warning": "#faad14",
133
+ "color-error": "#f87171",
134
+ "border-radius": "6px"
135
+ }
136
+ };
137
+ var getDerivedTokens = (prefix, themeName) => {
138
+ const opacity = themeName ? themePrimaryBgOpacity[themeName] ?? "0.1" : "0.1";
139
+ return {
140
+ "color-bg-container": `rgb(var(--${prefix}-color-secondary))`,
141
+ "color-text": `rgb(var(--${prefix}-color-primary-text) / 0.85)`,
142
+ "color-text-heading": `rgb(var(--${prefix}-color-primary-text))`,
143
+ "color-text-disabled": `rgb(var(--${prefix}-color-primary-text) / 0.25)`,
144
+ "color-primary-hover": `rgb(var(--${prefix}-color-brand-hover))`,
145
+ "color-primary-active": `rgb(var(--${prefix}-color-brand-active))`,
146
+ "color-primary-bg": `rgb(var(--${prefix}-color-brand) / ${opacity})`,
147
+ "line-height": "1.5715"
148
+ };
149
+ };
150
+ var defaultTokenMapping = {
151
+ "color-primary": "rgb(var(--${prefix}-color-primary))",
152
+ "color-primary-active": "rgb(var(--${prefix}-color-primary-active))",
153
+ "color-primary-hover": "rgb(var(--${prefix}-color-primary-hover))",
154
+ "color-primary-bg": "rgb(var(--${prefix}-color-primary-bg))",
155
+ "color-secondary": "rgb(var(--${prefix}-color-secondary))",
156
+ "color-elevated": "rgb(var(--${prefix}-color-elevated))",
157
+ "color-primary-text": "rgb(var(--${prefix}-color-primary-text))",
158
+ "color-primary-text-hover": "rgb(var(--${prefix}-color-primary-text-hover))",
159
+ "color-secondary-text": "rgb(var(--${prefix}-color-secondary-text))",
160
+ "color-tertiary-text": "rgb(var(--${prefix}-color-tertiary-text))",
161
+ "color-primary-border": "rgb(var(--${prefix}-color-primary-border))",
162
+ "color-brand": "rgb(var(--${prefix}-color-brand))",
163
+ "color-brand-hover": "rgb(var(--${prefix}-color-brand-hover))",
164
+ "color-brand-active": "rgb(var(--${prefix}-color-brand-active))",
165
+ /** Text/icons on brand-colored surfaces (buttons, badges) */
166
+ "color-on-brand": "#ffffff",
167
+ "color-progress-track": "rgb(var(--${prefix}-color-primary-border) / 0.5)",
168
+ "color-bg-container": "rgb(var(--${prefix}-color-bg-container))",
169
+ "font-sans": 'var(--font-inter), ui-sans-serif, system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif',
170
+ "animate-dashboard-skeleton-shimmer": "dashboard-skeleton-shimmer 1.6s ease-in-out infinite"
171
+ };
172
+ function getDefaultSelector(themeName, root) {
173
+ if (root) {
174
+ return `:root, html[data-theme="${themeName}"], [data-theme="${themeName}"]`;
175
+ }
176
+ return `html[data-theme="${themeName}"], [data-theme="${themeName}"]`;
177
+ }
178
+ var defaultConfig = {
179
+ prefix: "fe",
180
+ themes: {},
181
+ tokenMapping: defaultTokenMapping,
182
+ cssSelector: getDefaultSelector
183
+ };
184
+ function getConfig(options) {
185
+ const allThemes = deepMerge(builtinThemes, options?.themes || {});
186
+ const allMappings = deepMerge(
187
+ defaultTokenMapping,
188
+ options?.tokenMapping || {}
189
+ );
190
+ const config = Object.assign(
191
+ {},
192
+ defaultConfig,
193
+ options,
194
+ {
195
+ themes: allThemes,
196
+ tokenMapping: allMappings
197
+ }
198
+ );
199
+ if (!config.defaultTheme && config.themes) {
200
+ config.defaultTheme = Object.keys(config.themes)[0];
201
+ }
202
+ return config;
203
+ }
204
+
205
+ // src/core.ts
206
+ function generateLayerBaseCSS(options = {}) {
207
+ const config = getConfig(options);
208
+ const { prefix, themes, cssSelector, defaultTheme } = config;
209
+ let css = "";
210
+ for (const [themeName, vars] of Object.entries(themes)) {
211
+ const isDefault = themeName === defaultTheme;
212
+ const selector = cssSelector(themeName, isDefault);
213
+ const themeDerived = getDerivedTokens(prefix, themeName);
214
+ const merged = {
215
+ ...vars,
216
+ ...themeDerived
217
+ };
218
+ css += `${selector} {
219
+ `;
220
+ for (const [varName, value] of Object.entries(merged)) {
221
+ css += ` --${prefix}-${varName}: ${value};
222
+ `;
223
+ }
224
+ css += "}\n\n";
225
+ }
226
+ return css;
227
+ }
228
+ function generateThemeBlockCSS(options = {}) {
229
+ const config = getConfig(options);
230
+ const { prefix, tokenMapping = defaultTokenMapping } = config;
231
+ let css = "@theme {\n";
232
+ for (const [tokenName, tokenValue] of Object.entries(tokenMapping)) {
233
+ const finalValue = resolveTokenValue(tokenValue, prefix);
234
+ css += ` --${tokenName}: ${finalValue};
235
+ `;
236
+ }
237
+ css += "}\n";
238
+ return css;
239
+ }
240
+ function generateThemeCSS(options = {}) {
241
+ let css = "";
242
+ const layerBaseContent = generateLayerBaseCSS(options);
243
+ if (layerBaseContent) {
244
+ css += "@layer base {\n" + layerBaseContent + "}\n\n";
245
+ }
246
+ css += generateThemeBlockCSS(options);
247
+ return css;
248
+ }
249
+
250
+ // src/plugin.ts
251
+ var themePlugin = (userOptions = {}) => {
252
+ const { includePaths = ["/styles/index.css", "/styles/tailwind.css"] } = userOptions;
253
+ return {
254
+ postcssPlugin: "tailwind-theme-plugin",
255
+ Once(root, { postcss, result }) {
256
+ const from = result.opts.from ?? root.source?.input?.file ?? "";
257
+ const normalized = from.replace(/\\/g, "/");
258
+ const shouldProcess = includePaths.some(
259
+ (pattern) => normalized.endsWith(pattern)
260
+ );
261
+ if (normalized && !shouldProcess) {
262
+ return;
263
+ }
264
+ const finalCss = generateThemeCSS(userOptions);
265
+ root.prepend(postcss.parse(finalCss));
266
+ }
267
+ };
268
+ };
269
+ themePlugin.postcss = true;
270
+ var plugin_default = themePlugin;
271
+ export {
272
+ plugin_default as default
273
+ };
@@ -0,0 +1,21 @@
1
+ @theme {
2
+ --color-primary: rgb(var(--fe-color-primary));
3
+ --color-primary-active: rgb(var(--fe-color-primary-active));
4
+ --color-primary-hover: rgb(var(--fe-color-primary-hover));
5
+ --color-primary-bg: rgb(var(--fe-color-primary-bg));
6
+ --color-secondary: rgb(var(--fe-color-secondary));
7
+ --color-elevated: rgb(var(--fe-color-elevated));
8
+ --color-primary-text: rgb(var(--fe-color-primary-text));
9
+ --color-primary-text-hover: rgb(var(--fe-color-primary-text-hover));
10
+ --color-secondary-text: rgb(var(--fe-color-secondary-text));
11
+ --color-tertiary-text: rgb(var(--fe-color-tertiary-text));
12
+ --color-primary-border: rgb(var(--fe-color-primary-border));
13
+ --color-brand: rgb(var(--fe-color-brand));
14
+ --color-brand-hover: rgb(var(--fe-color-brand-hover));
15
+ --color-brand-active: rgb(var(--fe-color-brand-active));
16
+ --color-on-brand: #ffffff;
17
+ --color-progress-track: rgb(var(--fe-color-primary-border) / 0.5);
18
+ --color-bg-container: rgb(var(--fe-color-bg-container));
19
+ --font-sans: var(--font-inter), ui-sans-serif, system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
20
+ --animate-dashboard-skeleton-shimmer: dashboard-skeleton-shimmer 1.6s ease-in-out infinite;
21
+ }
@@ -0,0 +1,158 @@
1
+ @layer base {
2
+ :root, html[data-theme="light"], [data-theme="light"] {
3
+ --fe-color-primary: 246 248 250;
4
+ --fe-color-secondary: 255 255 255;
5
+ --fe-color-elevated: 240 242 244;
6
+ --fe-color-primary-text: 31 35 40;
7
+ --fe-color-primary-text-hover: 101 109 118;
8
+ --fe-color-secondary-text: 101 109 118;
9
+ --fe-color-tertiary-text: 140 149 159;
10
+ --fe-color-primary-border: 208 215 222;
11
+ --fe-color-brand: 124 58 237;
12
+ --fe-color-brand-hover: 109 40 217;
13
+ --fe-color-brand-active: 91 33 182;
14
+ --fe-color-success: #1a7f37;
15
+ --fe-color-warning: #faad14;
16
+ --fe-color-error: #cf222e;
17
+ --fe-border-radius: 6px;
18
+ --fe-color-bg-container: rgb(var(--fe-color-secondary));
19
+ --fe-color-text: rgb(var(--fe-color-primary-text) / 0.85);
20
+ --fe-color-text-heading: rgb(var(--fe-color-primary-text));
21
+ --fe-color-text-disabled: rgb(var(--fe-color-primary-text) / 0.25);
22
+ --fe-color-primary-hover: rgb(var(--fe-color-brand-hover));
23
+ --fe-color-primary-active: rgb(var(--fe-color-brand-active));
24
+ --fe-color-primary-bg: rgb(var(--fe-color-brand) / 0.08);
25
+ --fe-line-height: 1.5715;
26
+ }
27
+
28
+ html[data-theme="dark"], [data-theme="dark"] {
29
+ --fe-color-primary: 15 17 21;
30
+ --fe-color-secondary: 22 27 34;
31
+ --fe-color-elevated: 33 38 45;
32
+ --fe-color-primary-text: 230 237 243;
33
+ --fe-color-primary-text-hover: 139 148 158;
34
+ --fe-color-secondary-text: 139 148 158;
35
+ --fe-color-tertiary-text: 110 118 129;
36
+ --fe-color-primary-border: 48 54 61;
37
+ --fe-color-brand: 139 92 246;
38
+ --fe-color-brand-hover: 124 58 237;
39
+ --fe-color-brand-active: 109 40 217;
40
+ --fe-color-success: #3fb950;
41
+ --fe-color-warning: #faad14;
42
+ --fe-color-error: #f85149;
43
+ --fe-border-radius: 6px;
44
+ --fe-color-bg-container: rgb(var(--fe-color-secondary));
45
+ --fe-color-text: rgb(var(--fe-color-primary-text) / 0.85);
46
+ --fe-color-text-heading: rgb(var(--fe-color-primary-text));
47
+ --fe-color-text-disabled: rgb(var(--fe-color-primary-text) / 0.25);
48
+ --fe-color-primary-hover: rgb(var(--fe-color-brand-hover));
49
+ --fe-color-primary-active: rgb(var(--fe-color-brand-active));
50
+ --fe-color-primary-bg: rgb(var(--fe-color-brand) / 0.12);
51
+ --fe-line-height: 1.5715;
52
+ }
53
+
54
+ html[data-theme="pink"], [data-theme="pink"] {
55
+ --fe-color-primary: 26 13 20;
56
+ --fe-color-secondary: 37 16 27;
57
+ --fe-color-elevated: 48 21 34;
58
+ --fe-color-primary-text: 252 232 240;
59
+ --fe-color-primary-text-hover: 196 144 168;
60
+ --fe-color-secondary-text: 196 144 168;
61
+ --fe-color-tertiary-text: 138 88 112;
62
+ --fe-color-primary-border: 92 45 66;
63
+ --fe-color-brand: 244 114 182;
64
+ --fe-color-brand-hover: 236 72 153;
65
+ --fe-color-brand-active: 219 39 119;
66
+ --fe-color-success: #34d399;
67
+ --fe-color-warning: #faad14;
68
+ --fe-color-error: #fb7185;
69
+ --fe-border-radius: 8px;
70
+ --fe-color-bg-container: rgb(var(--fe-color-secondary));
71
+ --fe-color-text: rgb(var(--fe-color-primary-text) / 0.85);
72
+ --fe-color-text-heading: rgb(var(--fe-color-primary-text));
73
+ --fe-color-text-disabled: rgb(var(--fe-color-primary-text) / 0.25);
74
+ --fe-color-primary-hover: rgb(var(--fe-color-brand-hover));
75
+ --fe-color-primary-active: rgb(var(--fe-color-brand-active));
76
+ --fe-color-primary-bg: rgb(var(--fe-color-brand) / 0.12);
77
+ --fe-line-height: 1.5715;
78
+ }
79
+
80
+ html[data-theme="amber"], [data-theme="amber"] {
81
+ --fe-color-primary: 30 18 0;
82
+ --fe-color-secondary: 40 26 0;
83
+ --fe-color-elevated: 50 31 0;
84
+ --fe-color-primary-text: 242 232 213;
85
+ --fe-color-primary-text-hover: 184 166 138;
86
+ --fe-color-secondary-text: 184 166 138;
87
+ --fe-color-tertiary-text: 122 106 86;
88
+ --fe-color-primary-border: 74 56 0;
89
+ --fe-color-brand: 232 148 58;
90
+ --fe-color-brand-hover: 208 120 40;
91
+ --fe-color-brand-active: 180 100 30;
92
+ --fe-color-success: #5aad6e;
93
+ --fe-color-warning: #faad14;
94
+ --fe-color-error: #c85a4a;
95
+ --fe-border-radius: 6px;
96
+ --fe-color-bg-container: rgb(var(--fe-color-secondary));
97
+ --fe-color-text: rgb(var(--fe-color-primary-text) / 0.85);
98
+ --fe-color-text-heading: rgb(var(--fe-color-primary-text));
99
+ --fe-color-text-disabled: rgb(var(--fe-color-primary-text) / 0.25);
100
+ --fe-color-primary-hover: rgb(var(--fe-color-brand-hover));
101
+ --fe-color-primary-active: rgb(var(--fe-color-brand-active));
102
+ --fe-color-primary-bg: rgb(var(--fe-color-brand) / 0.12);
103
+ --fe-line-height: 1.5715;
104
+ }
105
+
106
+ html[data-theme="forest"], [data-theme="forest"] {
107
+ --fe-color-primary: 6 21 8;
108
+ --fe-color-secondary: 12 31 14;
109
+ --fe-color-elevated: 19 39 22;
110
+ --fe-color-primary-text: 216 240 220;
111
+ --fe-color-primary-text-hover: 136 173 142;
112
+ --fe-color-secondary-text: 136 173 142;
113
+ --fe-color-tertiary-text: 90 122 94;
114
+ --fe-color-primary-border: 44 66 48;
115
+ --fe-color-brand: 74 222 128;
116
+ --fe-color-brand-hover: 34 197 94;
117
+ --fe-color-brand-active: 22 163 74;
118
+ --fe-color-success: #86efac;
119
+ --fe-color-warning: #faad14;
120
+ --fe-color-error: #f87171;
121
+ --fe-border-radius: 6px;
122
+ --fe-color-bg-container: rgb(var(--fe-color-secondary));
123
+ --fe-color-text: rgb(var(--fe-color-primary-text) / 0.85);
124
+ --fe-color-text-heading: rgb(var(--fe-color-primary-text));
125
+ --fe-color-text-disabled: rgb(var(--fe-color-primary-text) / 0.25);
126
+ --fe-color-primary-hover: rgb(var(--fe-color-brand-hover));
127
+ --fe-color-primary-active: rgb(var(--fe-color-brand-active));
128
+ --fe-color-primary-bg: rgb(var(--fe-color-brand) / 0.1);
129
+ --fe-line-height: 1.5715;
130
+ }
131
+
132
+ html[data-theme="ocean"], [data-theme="ocean"] {
133
+ --fe-color-primary: 6 14 26;
134
+ --fe-color-secondary: 13 26 46;
135
+ --fe-color-elevated: 18 36 62;
136
+ --fe-color-primary-text: 218 238 255;
137
+ --fe-color-primary-text-hover: 122 181 212;
138
+ --fe-color-secondary-text: 122 181 212;
139
+ --fe-color-tertiary-text: 74 126 154;
140
+ --fe-color-primary-border: 30 58 92;
141
+ --fe-color-brand: 56 189 248;
142
+ --fe-color-brand-hover: 14 165 233;
143
+ --fe-color-brand-active: 2 132 199;
144
+ --fe-color-success: #34d399;
145
+ --fe-color-warning: #faad14;
146
+ --fe-color-error: #f87171;
147
+ --fe-border-radius: 6px;
148
+ --fe-color-bg-container: rgb(var(--fe-color-secondary));
149
+ --fe-color-text: rgb(var(--fe-color-primary-text) / 0.85);
150
+ --fe-color-text-heading: rgb(var(--fe-color-primary-text));
151
+ --fe-color-text-disabled: rgb(var(--fe-color-primary-text) / 0.25);
152
+ --fe-color-primary-hover: rgb(var(--fe-color-brand-hover));
153
+ --fe-color-primary-active: rgb(var(--fe-color-brand-active));
154
+ --fe-color-primary-bg: rgb(var(--fe-color-brand) / 0.1);
155
+ --fe-line-height: 1.5715;
156
+ }
157
+
158
+ }
package/dist/theme.css ADDED
@@ -0,0 +1,180 @@
1
+ @layer base {
2
+ :root, html[data-theme="light"], [data-theme="light"] {
3
+ --fe-color-primary: 246 248 250;
4
+ --fe-color-secondary: 255 255 255;
5
+ --fe-color-elevated: 240 242 244;
6
+ --fe-color-primary-text: 31 35 40;
7
+ --fe-color-primary-text-hover: 101 109 118;
8
+ --fe-color-secondary-text: 101 109 118;
9
+ --fe-color-tertiary-text: 140 149 159;
10
+ --fe-color-primary-border: 208 215 222;
11
+ --fe-color-brand: 124 58 237;
12
+ --fe-color-brand-hover: 109 40 217;
13
+ --fe-color-brand-active: 91 33 182;
14
+ --fe-color-success: #1a7f37;
15
+ --fe-color-warning: #faad14;
16
+ --fe-color-error: #cf222e;
17
+ --fe-border-radius: 6px;
18
+ --fe-color-bg-container: rgb(var(--fe-color-secondary));
19
+ --fe-color-text: rgb(var(--fe-color-primary-text) / 0.85);
20
+ --fe-color-text-heading: rgb(var(--fe-color-primary-text));
21
+ --fe-color-text-disabled: rgb(var(--fe-color-primary-text) / 0.25);
22
+ --fe-color-primary-hover: rgb(var(--fe-color-brand-hover));
23
+ --fe-color-primary-active: rgb(var(--fe-color-brand-active));
24
+ --fe-color-primary-bg: rgb(var(--fe-color-brand) / 0.08);
25
+ --fe-line-height: 1.5715;
26
+ }
27
+
28
+ html[data-theme="dark"], [data-theme="dark"] {
29
+ --fe-color-primary: 15 17 21;
30
+ --fe-color-secondary: 22 27 34;
31
+ --fe-color-elevated: 33 38 45;
32
+ --fe-color-primary-text: 230 237 243;
33
+ --fe-color-primary-text-hover: 139 148 158;
34
+ --fe-color-secondary-text: 139 148 158;
35
+ --fe-color-tertiary-text: 110 118 129;
36
+ --fe-color-primary-border: 48 54 61;
37
+ --fe-color-brand: 139 92 246;
38
+ --fe-color-brand-hover: 124 58 237;
39
+ --fe-color-brand-active: 109 40 217;
40
+ --fe-color-success: #3fb950;
41
+ --fe-color-warning: #faad14;
42
+ --fe-color-error: #f85149;
43
+ --fe-border-radius: 6px;
44
+ --fe-color-bg-container: rgb(var(--fe-color-secondary));
45
+ --fe-color-text: rgb(var(--fe-color-primary-text) / 0.85);
46
+ --fe-color-text-heading: rgb(var(--fe-color-primary-text));
47
+ --fe-color-text-disabled: rgb(var(--fe-color-primary-text) / 0.25);
48
+ --fe-color-primary-hover: rgb(var(--fe-color-brand-hover));
49
+ --fe-color-primary-active: rgb(var(--fe-color-brand-active));
50
+ --fe-color-primary-bg: rgb(var(--fe-color-brand) / 0.12);
51
+ --fe-line-height: 1.5715;
52
+ }
53
+
54
+ html[data-theme="pink"], [data-theme="pink"] {
55
+ --fe-color-primary: 26 13 20;
56
+ --fe-color-secondary: 37 16 27;
57
+ --fe-color-elevated: 48 21 34;
58
+ --fe-color-primary-text: 252 232 240;
59
+ --fe-color-primary-text-hover: 196 144 168;
60
+ --fe-color-secondary-text: 196 144 168;
61
+ --fe-color-tertiary-text: 138 88 112;
62
+ --fe-color-primary-border: 92 45 66;
63
+ --fe-color-brand: 244 114 182;
64
+ --fe-color-brand-hover: 236 72 153;
65
+ --fe-color-brand-active: 219 39 119;
66
+ --fe-color-success: #34d399;
67
+ --fe-color-warning: #faad14;
68
+ --fe-color-error: #fb7185;
69
+ --fe-border-radius: 8px;
70
+ --fe-color-bg-container: rgb(var(--fe-color-secondary));
71
+ --fe-color-text: rgb(var(--fe-color-primary-text) / 0.85);
72
+ --fe-color-text-heading: rgb(var(--fe-color-primary-text));
73
+ --fe-color-text-disabled: rgb(var(--fe-color-primary-text) / 0.25);
74
+ --fe-color-primary-hover: rgb(var(--fe-color-brand-hover));
75
+ --fe-color-primary-active: rgb(var(--fe-color-brand-active));
76
+ --fe-color-primary-bg: rgb(var(--fe-color-brand) / 0.12);
77
+ --fe-line-height: 1.5715;
78
+ }
79
+
80
+ html[data-theme="amber"], [data-theme="amber"] {
81
+ --fe-color-primary: 30 18 0;
82
+ --fe-color-secondary: 40 26 0;
83
+ --fe-color-elevated: 50 31 0;
84
+ --fe-color-primary-text: 242 232 213;
85
+ --fe-color-primary-text-hover: 184 166 138;
86
+ --fe-color-secondary-text: 184 166 138;
87
+ --fe-color-tertiary-text: 122 106 86;
88
+ --fe-color-primary-border: 74 56 0;
89
+ --fe-color-brand: 232 148 58;
90
+ --fe-color-brand-hover: 208 120 40;
91
+ --fe-color-brand-active: 180 100 30;
92
+ --fe-color-success: #5aad6e;
93
+ --fe-color-warning: #faad14;
94
+ --fe-color-error: #c85a4a;
95
+ --fe-border-radius: 6px;
96
+ --fe-color-bg-container: rgb(var(--fe-color-secondary));
97
+ --fe-color-text: rgb(var(--fe-color-primary-text) / 0.85);
98
+ --fe-color-text-heading: rgb(var(--fe-color-primary-text));
99
+ --fe-color-text-disabled: rgb(var(--fe-color-primary-text) / 0.25);
100
+ --fe-color-primary-hover: rgb(var(--fe-color-brand-hover));
101
+ --fe-color-primary-active: rgb(var(--fe-color-brand-active));
102
+ --fe-color-primary-bg: rgb(var(--fe-color-brand) / 0.12);
103
+ --fe-line-height: 1.5715;
104
+ }
105
+
106
+ html[data-theme="forest"], [data-theme="forest"] {
107
+ --fe-color-primary: 6 21 8;
108
+ --fe-color-secondary: 12 31 14;
109
+ --fe-color-elevated: 19 39 22;
110
+ --fe-color-primary-text: 216 240 220;
111
+ --fe-color-primary-text-hover: 136 173 142;
112
+ --fe-color-secondary-text: 136 173 142;
113
+ --fe-color-tertiary-text: 90 122 94;
114
+ --fe-color-primary-border: 44 66 48;
115
+ --fe-color-brand: 74 222 128;
116
+ --fe-color-brand-hover: 34 197 94;
117
+ --fe-color-brand-active: 22 163 74;
118
+ --fe-color-success: #86efac;
119
+ --fe-color-warning: #faad14;
120
+ --fe-color-error: #f87171;
121
+ --fe-border-radius: 6px;
122
+ --fe-color-bg-container: rgb(var(--fe-color-secondary));
123
+ --fe-color-text: rgb(var(--fe-color-primary-text) / 0.85);
124
+ --fe-color-text-heading: rgb(var(--fe-color-primary-text));
125
+ --fe-color-text-disabled: rgb(var(--fe-color-primary-text) / 0.25);
126
+ --fe-color-primary-hover: rgb(var(--fe-color-brand-hover));
127
+ --fe-color-primary-active: rgb(var(--fe-color-brand-active));
128
+ --fe-color-primary-bg: rgb(var(--fe-color-brand) / 0.1);
129
+ --fe-line-height: 1.5715;
130
+ }
131
+
132
+ html[data-theme="ocean"], [data-theme="ocean"] {
133
+ --fe-color-primary: 6 14 26;
134
+ --fe-color-secondary: 13 26 46;
135
+ --fe-color-elevated: 18 36 62;
136
+ --fe-color-primary-text: 218 238 255;
137
+ --fe-color-primary-text-hover: 122 181 212;
138
+ --fe-color-secondary-text: 122 181 212;
139
+ --fe-color-tertiary-text: 74 126 154;
140
+ --fe-color-primary-border: 30 58 92;
141
+ --fe-color-brand: 56 189 248;
142
+ --fe-color-brand-hover: 14 165 233;
143
+ --fe-color-brand-active: 2 132 199;
144
+ --fe-color-success: #34d399;
145
+ --fe-color-warning: #faad14;
146
+ --fe-color-error: #f87171;
147
+ --fe-border-radius: 6px;
148
+ --fe-color-bg-container: rgb(var(--fe-color-secondary));
149
+ --fe-color-text: rgb(var(--fe-color-primary-text) / 0.85);
150
+ --fe-color-text-heading: rgb(var(--fe-color-primary-text));
151
+ --fe-color-text-disabled: rgb(var(--fe-color-primary-text) / 0.25);
152
+ --fe-color-primary-hover: rgb(var(--fe-color-brand-hover));
153
+ --fe-color-primary-active: rgb(var(--fe-color-brand-active));
154
+ --fe-color-primary-bg: rgb(var(--fe-color-brand) / 0.1);
155
+ --fe-line-height: 1.5715;
156
+ }
157
+
158
+ }
159
+
160
+ @theme {
161
+ --color-primary: rgb(var(--fe-color-primary));
162
+ --color-primary-active: rgb(var(--fe-color-primary-active));
163
+ --color-primary-hover: rgb(var(--fe-color-primary-hover));
164
+ --color-primary-bg: rgb(var(--fe-color-primary-bg));
165
+ --color-secondary: rgb(var(--fe-color-secondary));
166
+ --color-elevated: rgb(var(--fe-color-elevated));
167
+ --color-primary-text: rgb(var(--fe-color-primary-text));
168
+ --color-primary-text-hover: rgb(var(--fe-color-primary-text-hover));
169
+ --color-secondary-text: rgb(var(--fe-color-secondary-text));
170
+ --color-tertiary-text: rgb(var(--fe-color-tertiary-text));
171
+ --color-primary-border: rgb(var(--fe-color-primary-border));
172
+ --color-brand: rgb(var(--fe-color-brand));
173
+ --color-brand-hover: rgb(var(--fe-color-brand-hover));
174
+ --color-brand-active: rgb(var(--fe-color-brand-active));
175
+ --color-on-brand: #ffffff;
176
+ --color-progress-track: rgb(var(--fe-color-primary-border) / 0.5);
177
+ --color-bg-container: rgb(var(--fe-color-bg-container));
178
+ --font-sans: var(--font-inter), ui-sans-serif, system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
179
+ --animate-dashboard-skeleton-shimmer: dashboard-skeleton-shimmer 1.6s ease-in-out infinite;
180
+ }