This repository has been archived by the owner on Oct 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathtailwind.config.cjs
55 lines (52 loc) · 1.57 KB
/
tailwind.config.cjs
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
const defaultTheme = require('tailwindcss/defaultTheme')
// Connect extended colors in manner that still allows them to
// utilize Tailwind's opacity utilities (text-opacity, etc.)
// https://github.com/adamwathan/tailwind-css-variable-text-opacity-demo
function cssVarHslHelper(cssVariable) {
return ({ opacityVariable, opacityValue }) => {
if (opacityValue !== undefined) {
return `hsla(var(--${cssVariable}), ${opacityValue})`;
}
if (opacityVariable !== undefined) {
return `hsla(var(--${cssVariable}), var(${opacityVariable}, 1))`;
}
return `hsl(var(--${cssVariable}))`;
};
}
module.exports = {
mode: "jit",
separator: '_',
purge: {
content: ["./src/**/*.{html,js,svelte,ts}"],
options: {
keyframes: true,
},
},
theme: {
extend: {
fontFamily: {
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
},
colors: {
brand: {
lightest: cssVarHslHelper('color-brand-lightest'),
light: cssVarHslHelper('color-brand-light'),
DEFAULT: cssVarHslHelper('color-brand-default'),
dark: cssVarHslHelper('color-brand-dark'),
},
action: {
highlight: cssVarHslHelper('color-action-highlight'),
hover: cssVarHslHelper('color-action-hover'),
DEFAULT: cssVarHslHelper('color-action-default'),
focus: cssVarHslHelper('color-action-focus'),
},
}
},
},
plugins: [
require('@tailwindcss/typography'),
require('@tailwindcss/forms'),
],
};
// discussion about TW supporting dynamically Svelte generated class names
// https://github.com/tailwindlabs/tailwindcss/discussions/1731