Skip to content

Commit 9e927fc

Browse files
committed
refactor(unocss): change to presetWind3
1 parent fcfb6f4 commit 9e927fc

File tree

1 file changed

+45
-2
lines changed

1 file changed

+45
-2
lines changed

dev/uno.config.ts

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,62 @@
11
import {
22
defineConfig,
33
presetIcons,
4-
presetUno,
4+
presetWind3,
55
transformerDirectives,
66
transformerVariantGroup,
77
} from 'unocss'
88

9+
function convert(color: string) {
10+
return `color-mix(in srgb, ${color} 100%, transparent)`
11+
}
12+
913
export default defineConfig({
1014
presets: [
11-
presetUno(),
15+
presetWind3(),
1216
presetIcons({
1317
scale: 1.2,
1418
unit: 'em',
1519
}),
1620
],
21+
theme: {
22+
colors: {
23+
'primary': convert('var(--p-primary-color)'),
24+
'primary-emphasis': convert('var(--p-primary-hover-color)'),
25+
'primary-emphasis-alt': convert('var(--p-primary-active-color)'),
26+
'primary-contrast': convert('var(--p-primary-contrast-color)'),
27+
'primary-50': convert('var(--p-primary-50)'),
28+
'primary-100': convert('var(--p-primary-100)'),
29+
'primary-200': convert('var(--p-primary-200)'),
30+
'primary-300': convert('var(--p-primary-300)'),
31+
'primary-400': convert('var(--p-primary-400)'),
32+
'primary-500': convert('var(--p-primary-500)'),
33+
'primary-600': convert('var(--p-primary-600)'),
34+
'primary-700': convert('var(--p-primary-700)'),
35+
'primary-800': convert('var(--p-primary-800)'),
36+
'primary-900': convert('var(--p-primary-900)'),
37+
'primary-950': convert('var(--p-primary-950)'),
38+
'surface-0': convert('var(--p-surface-0)'),
39+
'surface-50': convert('var(--p-surface-50)'),
40+
'surface-100': convert('var(--p-surface-100)'),
41+
'surface-200': convert('var(--p-surface-200)'),
42+
'surface-300': convert('var(--p-surface-300)'),
43+
'surface-400': convert('var(--p-surface-400)'),
44+
'surface-500': convert('var(--p-surface-500)'),
45+
'surface-600': convert('var(--p-surface-600)'),
46+
'surface-700': convert('var(--p-surface-700)'),
47+
'surface-800': convert('var(--p-surface-800)'),
48+
'surface-900': convert('var(--p-surface-900)'),
49+
'surface-950': convert('var(--p-surface-950)'),
50+
},
51+
breakpoints: {
52+
sm: '640px',
53+
md: '768px',
54+
lg: '1024px',
55+
xl: '1280px',
56+
xxl: '1536px',
57+
},
58+
59+
},
1760
transformers: [
1861
transformerVariantGroup(),
1962
transformerDirectives(),

0 commit comments

Comments
 (0)