-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtailwind.config.js
More file actions
32 lines (31 loc) · 1.03 KB
/
tailwind.config.js
File metadata and controls
32 lines (31 loc) · 1.03 KB
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
module.exports = {
content: ["./public/**/*.{html,js}", "./views/**/*.{html,js,ejs}"],
theme: {
extend: {
fontFamily: {
sans: ["Helvetica", "Arial", "sans-serif"],
},
colors: {
primary: withOpacityValue("--color-primary"),
"primary-accent": withOpacityValue("--color-primary-accent"),
"primary-muted": withOpacityValue("--color-primary-muted"),
neutral: withOpacityValue("--color-text-neutral"),
muted: withOpacityValue("--color-text-muted"),
foreground: withOpacityValue("--color-foreground"),
background: withOpacityValue("--color-background"),
success: withOpacityValue("--color-success"),
danger: withOpacityValue("--color-danger"),
warning: withOpacityValue("--color-warning"),
},
},
plugins: [],
},
};
function withOpacityValue(variable) {
return ({ opacityValue }) => {
if (opacityValue === undefined) {
return `rgb(var(${variable}))`;
}
return `rgb(var(${variable}) / ${opacityValue})`;
};
}