-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.js
58 lines (57 loc) · 2 KB
/
tailwind.config.js
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
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./layout/**/*.liquid",
"./snippets/**/*.liquid",
"./templates/**/*.liquid",
"./statics/**/*.liquid"
],
darkMode: 'class',
theme: {
extend: {
colors: () => {
return {
slate: {
150: "#E9EEF5"
},
...["primary", "secondary", "accent", "info", "success", "warning"].reduce((map, name) => {
return {
...map,
[name]: {
DEFAULT: `hsl(var(--theme-color-${name}) / <alpha-value>)`,
lighten: `hsl(var(--theme-color-${name}-hsl-h) var(--theme-color-${name}-hsl-s) calc(var(--theme-color-${name}-hsl-l) + 15%))`,
darken: `hsl(var(--theme-color-${name}-hsl-h) var(--theme-color-${name}-hsl-s) calc(var(--theme-color-${name}-hsl-l) - 15%))`,
...[50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].reduce((map,lightness) => {
return {
...map,
[lightness]: `hsl(var(--theme-color-${name}-hsl-h) var(--theme-color-${name}-hsl-s) ${100 - lightness/10*0.8}%)`
}
}, {})
}
}
}, {}),
// 错误色永远是红色,饱和度与主色调保持一致
error: {
DEFAULT: `hsl(355 75% var(--theme-color-primary-hsl-l) / <alpha-value>)`,
lighten: `hsl(355 75% calc(var(--theme-color-primary-hsl-l) + 15%))`,
darken: `hsl(355 75% calc(var(--theme-color-primary-hsl-l) - 15%))`,
...[50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].reduce((map,lightness) => {
return {
...map,
[lightness]: `hsl(355 75% ${100 - lightness/10*0.8}%)`
}
}, {})
}
}
},
spacing: {
4.5: "1.125rem",
5.5: "1.375rem",
18: "4.5rem",
}
},
},
plugins: [
require('@tailwindcss/typography')
],
}