-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtailwind.config.js
183 lines (174 loc) · 5.72 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
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ["class"], // to use this, add class="dark" to the corresponding html tag
content: [
"./pages/**/*.{js,jsx}",
"./components/**/*.{js,jsx}",
"./app/**/*.{js,jsx}",
"./src/**/*.{js,jsx}",
],
prefix: "", // optinal: add a prefix to all classes; e.g. "tw-" will result in "tw-bg-primary"
theme: {
// to define our design system (colors, spacing, etc.)
// tailwindcss default values:
container: {
// the class .container comes from tailwindcss
center: true, // centers the container
padding: "2rem",
screens: {
// breakpoints for the container (for different screen sizes)
"2xl": "1400px", // max-width: 1400px (for screens 2xl (ca. 1536 px) and up)
},
},
// Extensions:
// extend the tailwindcss default values:
extend: {
colors: {
border: "hsl(var(--border))",
// the key "border" has the value-placeholder of the css variable "--border". The concrete value is in index.css;
//! If we change the name of the variable in the index.css file, we have to change the key here as well!
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
// Custom Colors:
"selected-subemotion": "hsl(var(--selected-subemotion))",
"accent-color": "hsl(var(--accent-color))",
"selected-tag": "hsl(var(--selected-tag))",
// Color for specific purposes Extensions:
// shadcn/ui purposes: primary, secondary, destructive, muted, accent, popover, card
// DEFAULT: main color if nothing is specified
// foreground: color for text and icons
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))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
/* custom test */
customtest: {
DEFAULT: "hsl(var(--customtest))",
foreground: "hsl(var(--customtest-foreground))",
},
},
// Border Radius Extensions:
borderRadius: {
lg: "var(--radius)", //"--radius" in index.css
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)",
},
// Font Family Extensions:
fontFamily: {
primary: ["var(--font-primary)"],
highlight: ["var(--font-highlight)"],
},
// Custom Font Size Extensions:
fontSize: {
xs: "0.625rem", // 10px
sm: "0.75rem", // 12px
md: "1.25rem", // 20px
lg: "2.5rem", // 40px
xl: "3.75rem", // 60px
},
// Custom Line Height Extensions:
lineHeight: {
16: "1rem", // 16px
20: "1.25rem", // 20px
26: "1.625rem", // 26px
30: "1.875rem", // 30px
},
// Custom Spacing Extensions:
letterSpacing: {
tight: "-0.022em", // -0.22px
},
// Custom Rotate Extension for rotate(-2.065deg) --rotate-on-hover in index.css
rotate: {
"-2.065": "-2.065deg",
},
transform: {
"rotate-on-hover": "rotate(-2.065deg)",
},
// Keyframes for animations Extensions:
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" },
},
wobble: {
"0%": { transform: "translateX(0%)" },
"15%": { transform: "translateX(-25%) rotate(-5deg)" },
"30%": { transform: "translateX(20%) rotate(3deg)" },
"45%": { transform: "translateX(-15%) rotate(-3deg)" },
"60%": { transform: "translateX(10%) rotate(2deg)" },
"75%": { transform: "translateX(-5%) rotate(-1deg)" },
"100%": { transform: "translateX(0%)" },
},
},
animation: {
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
wobble: "wobble 0.8s ease-in-out",
},
},
},
// Plugins (to add third party plugins to tailwindcss)
plugins: [
require("tailwindcss-animate"),
function ({ addUtilities }) {
addUtilities(
{
/* custom rotation for selected subemotions */
".rotate-on-hover": {
"&:hover": {
transform: "rotate(-2.065deg)",
transitionDuration: "0.2s",
},
},
// Add new utilities for the Slider component
".slider-track": {
"&[data-disabled]": {
opacity: "1",
},
},
".slider-range": {
"&[data-disabled]": {
opacity: "0.5",
},
},
".slider-thumb": {
"&[data-disabled]": {
opacity: "0.5",
},
},
},
["responsive", "hover", "focus", "disabled"]
);
},
],
};