-
Notifications
You must be signed in to change notification settings - Fork 585
/
Copy pathtailwind.config.ts
212 lines (209 loc) · 6.71 KB
/
tailwind.config.ts
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
import tailwindContainerQueries from '@tailwindcss/container-queries'
import tailwindTypography from '@tailwindcss/typography'
import {mapValues} from 'remeda'
import tailwindCssAnimate from 'tailwindcss-animate'
import defaultTheme from 'tailwindcss/defaultTheme'
import {PluginAPI} from 'tailwindcss/types/config'
import {screens} from './src/utils/tw'
/** @type {import('tailwindcss').Config} */
export default {
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}', './stories/**/*.{js,ts,jsx,tsx}'],
future: {
// This allows ring-brand/40 (ring color with opacity to work correctly)
// https://github.com/tailwindlabs/tailwindcss/issues/9016#issuecomment-1205713065
respectDefaultRingColorOpacity: true,
},
theme: {
fontFamily: {
sans: ['var(--font-inter)', ...defaultTheme.fontFamily.sans],
mono: ['Roboto', ...defaultTheme.fontFamily.mono],
},
container: {
center: true,
padding: '2rem',
},
screens: mapValues(screens, (value) => value + 'px'),
extend: {
flexShrink: {
// Used if you want to shrink the item totally if no room
full: '9999',
},
borderRadius: {
// Using numbers instead of sm, md, lg because easier to add radii in between later
3: '3px',
4: '4px',
5: '5px',
6: '6px',
8: '8px',
10: '10px',
12: '12px',
15: '15px',
17: '17px',
20: '20px',
24: '24px',
},
colors: {
// Extracted from background
brand: 'hsl(var(--color-brand) / <alpha-value>)',
'brand-lighter': 'hsl(var(--color-brand-lighter) / <alpha-value>)',
'brand-lightest': 'hsl(var(--color-brand-lightest) / <alpha-value>)',
//
destructive: '#E03E3E',
destructive2: '#E22C2C',
'destructive2-lighter': '#F53737',
'destructive2-lightest': '#F45A5A',
success: '#299E16',
'success-light': '#51CB41',
'dialog-content': '#1E1E1E',
},
borderWidth: {
px: '1px',
hpx: '0.5px',
},
boxShadow: {
dock: '1.06058px 0px 0px 0px rgba(255, 255, 255, 0.04) inset, -1.06058px 0px 0px 0px rgba(255, 255, 255, 0.04) inset, 0px 1.06058px 0px 0px rgba(255, 255, 255, 0.20) inset, 0px 0.53029px 0px 0px rgba(255, 255, 255, 0.10) inset, 0px 4.04029px 24.24174px 0px rgba(0, 0, 0, 0.56)',
'floating-island':
'1.06058px 0px 0px 0px rgba(255, 255, 255, 0.04) inset, -1.06058px 0px 0px 0px rgba(255, 255, 255, 0.04) inset, 0px 1.06058px 0px 0px rgba(255, 255, 255, 0.14) inset, 0px 0.53029px 0px 0px rgba(255, 255, 255, 0.07) inset, 0px 4.04029px 24.24174px 0px rgba(0, 0, 0, 0.56)',
'glass-button':
'1px 0px 0px 0px rgba(255, 255, 255, 0.04) inset, -1px 0px 0px 0px rgba(255, 255, 255, 0.04) inset, 0px 1px 0px 0px rgba(255, 255, 255, 0.20) inset, 0px 0.5px 0px 0px rgba(255, 255, 255, 0.10) inset',
widget:
'0px 20px 30px 0px rgba(0, 0, 0, 0.30), 0 1px 0 0 rgba(255, 255, 255, 0.2) inset, 1px 0 0 0 rgba(255, 255, 255, 0.04) inset, -1px 0 0 0 rgba(255, 255, 255, 0.04) inset',
'context-menu':
'1.05px 0px 0px 0px rgba(255, 255, 255, 0.04) inset, -1.05px 0px 0px 0px rgba(255, 255, 255, 0.04) inset, 0px 0.525px 0px 0px rgba(255, 255, 255, 0.10) inset, 0px 24px 36px 0px rgba(0, 0, 0, 0.50)',
'sheet-shadow': '2px 2px 2px 0px rgba(255, 255, 255, 0.05) inset',
dropdown:
'0px 60px 24px -40px rgba(0, 0, 0, 0.25), 1px 1px 0px 0px rgba(255, 255, 255, 0.08) inset, -1px -1px 1px 0px rgba(0, 0, 0, 0.20) inset',
dialog: '0px 20px 36px 0px rgba(0, 0, 0, 0.25), 0px 1px 1px 0px rgba(255, 255, 255, 0.1) inset',
'button-highlight': '0px 1px 0px 0px rgba(255, 255, 255, 0.3) inset',
'button-highlight-hpx': '0px 0.5px 0px 0px rgba(255, 255, 255, 0.3) inset',
'button-highlight-soft': '0px 1px 0px 0px rgba(255, 255, 255, 0.1) inset',
'button-highlight-soft-hpx': '0px 0.5px 0px 0px rgba(255, 255, 255, 0.1) inset',
'immersive-dialog-close':
'0px 32px 32px 0px rgba(0, 0, 0, 0.32), 1px 1px 1px 0px rgba(255, 255, 255, 0.08) inset',
'radio-outline': '0 0 0 1px rgba(255, 255, 255, 0.2) inset',
},
dropShadow: {
'desktop-label': '0px 2px 4px rgba(0, 0, 0, 0.60)',
},
opacity: {
3: '0.03',
4: '0.04',
6: '0.06',
},
fontSize: {
9: '9px',
11: '11px',
12: '12px',
13: '13px',
14: '14px',
15: '15px',
16: '16px',
17: '17px',
19: '19px',
24: '24px',
32: '32px',
36: '36px',
48: '48px',
56: '56px',
},
backdropBlur: {
'4xl': '180px',
},
lineHeight: {
'inter-trimmed': '0.73',
},
lineClamp: {
10: '10',
},
letterSpacing: {
'1': '0.01em',
'2': '0.02em',
'3': '0.03em',
'4': '0.04em',
},
ringWidth: {
3: '3px',
6: '6px',
},
aspectRatio: {
'2.25': '225 / 100',
'1.6': '160 / 100',
'1.9': '190 / 100',
},
keyframes: {
'accordion-down': {
from: {height: '0px'},
to: {height: 'var(--radix-accordion-content-height)'},
},
'accordion-up': {
from: {height: 'var(--radix-accordion-content-height)'},
to: {height: '0px'},
},
// Keyframes from:
// https://css-tricks.com/snippets/css/shake-css-keyframe-animation/
shake: {
'10%, 90%': {
transform: 'translate3d(-1px, 0, 0)',
},
'20%, 80%': {
transform: 'translate3d(2px, 0, 0)',
},
'30%, 50%, 70%': {
transform: 'translate3d(-4px, 0, 0)',
},
'40%, 60%': {
transform: 'translate3d(4px, 0, 0)',
},
},
'sliding-loader': {
'0%, 100%': {
left: '-30%',
},
'50%': {
left: '100%',
},
},
'files-drop-zone-ripple': {
'0%, 100%': {
transform: 'translate(-50%, -50%) scale(1)',
},
'50%': {
transform: 'translate(-50%, -50%) scale(0.9)',
},
},
'files-folder-blink-on-drag-hover': {
'0%, 100%': {backgroundColor: 'hsl(var(--color-brand))'},
'25%, 75%': {backgroundColor: 'transparent'},
'50%': {backgroundColor: 'hsl(var(--color-brand))'},
},
},
animation: {
'files-drop-zone-ripple': 'files-drop-zone-ripple var(--duration,2s) ease calc(var(--i, 0)*.2s) infinite',
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out',
shake: 'shake 0.7s ease-out both',
'sliding-loader': 'sliding-loader 1s ease infinite',
'files-folder-blink-on-drag-hover': 'files-folder-blink-on-drag-hover 0.4s linear',
},
typography: () => ({
neutral: {
css: {
'--tw-prose-invert-bullets': 'rgb(255 255 255 / 50%)',
'--tw-prose-invert-pre-bg': 'rgb(255 255 255 / 10%)',
},
},
}),
},
},
plugins: [tailwindCssAnimate, tailwindContainerQueries, tailwindTypography, utilPlugin],
}
function utilPlugin(plugin: PluginAPI) {
plugin.addUtilities({
'.absolute-center': {
position: 'absolute',
left: '50%',
top: '50%',
transform: 'translate(-50%, -50%)',
},
})
}