-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.base.js
161 lines (158 loc) · 4.9 KB
/
tailwind.config.base.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { fontFamily } = require('tailwindcss/defaultTheme');
const typography = require('@tailwindcss/typography');
const forms = require('@tailwindcss/forms');
const animate = require('tailwindcss-animate');
const gradients = require('tailwindcss-gradients');
const plugin = require('tailwindcss/plugin');
/**
* @type {import('@types/tailwindcss/tailwind-config').TailwindConfig}
*/
const screens = {
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
'2xl': '1536px',
};
module.exports = {
darkMode: 'class',
// prefix: 'off-', // avoid conflicts with other website css class names
theme: {
container: {
center: true,
padding: '2rem',
screens: {
'2xl': '1400px',
},
},
extend: {
colors: {
border: 'hsl(var(--border))',
input: {
DEFAULT: 'hsl(var(--input))',
distinct: 'hsl(var(--input-distinct))',
},
ring: 'hsl(var(--ring))',
background: 'hsl(var(--background))',
foreground: 'hsl(var(--foreground))',
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))',
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))',
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))',
},
info: {
DEFAULT: 'hsl(var(--info))',
foreground: 'hsl(var(--info-foreground))',
border: 'hsl(var(--info-border))',
},
success: {
DEFAULT: 'hsl(var(--success))',
foreground: 'hsl(var(--success-foreground))',
border: 'hsl(var(--success-border))',
},
warning: {
DEFAULT: 'hsl(var(--warning))',
foreground: 'hsl(var(--warning-foreground))',
border: 'hsl(var(--warning-border))',
},
failure: {
DEFAULT: 'hsl(var(--failure))',
foreground: 'hsl(var(--failure-foreground))',
border: 'hsl(var(--failure-border))',
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))',
distinct: 'hsl(var(--muted-distinct))',
},
skeleton: {
DEFAULT: 'hsl(var(--skeleton))',
distinct: 'hsl(var(--skeleton-distinct))',
},
distinct: {
DEFAULT: 'hsl(var(--distinct))',
border: 'hsl(var(--distinct-border))',
},
image: {
DEFAULT: 'hsl(var(--image))',
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))',
distinct: 'hsl(var(--accent-distinct))',
'distinct-foreground': 'hsl(var(--accent-distinct-foreground))',
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))',
},
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))',
},
},
borderRadius: {
xl: `calc(var(--radius) + 4px)`,
lg: `var(--radius)`,
md: `calc(var(--radius) - 2px)`,
sm: 'calc(var(--radius) - 4px)',
},
fontFamily: {
sans: [
'var(--font-sans), -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
],
},
keyframes: {
'accordion-down': {
from: { height: 0 },
to: { height: 'var(--radix-accordion-content-height)' },
},
'accordion-up': {
from: { height: 'var(--radix-accordion-content-height)' },
to: { height: 0 },
},
'caret-blink': {
'0%,70%,100%': { opacity: '1' },
'20%,50%': { opacity: '0' },
},
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out',
'caret-blink': 'caret-blink 1.25s ease-out infinite',
},
},
screens,
},
variants: {
extend: {},
},
plugins: [
animate,
typography,
forms,
gradients,
plugin(function ({ addUtilities, theme, e, variants }) {
const colors = theme('colors');
const utilities = Object.entries(colors).map(
([colorName, colorValue]) => ({
// eslint-disable-next-line sonarjs/no-nested-template-literals
[`.${e(`bg-overlay-${colorName}`)}`]: {
background: `linear-gradient(var(--overlay-angle, 0deg), ${colorValue}, transparent), var(--overlay-image)`,
'background-position': 'center',
'background-size': 'cover',
},
}),
);
addUtilities(utilities, variants('backgroundColor'));
}),
],
};