-
Notifications
You must be signed in to change notification settings - Fork 11
/
tailwind.config.js
88 lines (85 loc) · 2.31 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
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* Copyright Oxide Computer Company
*/
// @ts-check
/** @type {import('tailwindcss/lib/util/createPlugin').default} */
// @ts-expect-error
const plugin = require('tailwindcss/plugin')
const {
textUtilities,
colorUtilities,
borderRadiusTokens,
elevationUtilities,
} = require('@oxide/design-system/styles/dist/tailwind-tokens.js')
/** @type {import('tailwindcss/tailwind-config').TailwindConfig} */
module.exports = {
corePlugins: {
fontFamily: false,
fontSize: false,
},
content: ['./app/**/*.{ts,tsx}'],
theme: {
extend: {
screens: {
'xl-': { max: '1535px' },
'lg-': { max: '1279px' },
'md-': { max: '1023px' },
'sm-': { max: '767px' },
'sm+': { min: '640px' },
'md+': { min: '768px' },
'lg+': { min: '1024px' },
'xl+': { min: '1280px' },
'2xl+': { min: '1536px' },
sm: { min: '640px', max: '767px' },
md: { min: '768px', max: '1023px' },
lg: { min: '1024px', max: '1279px' },
xl: { min: '1280px', max: '1535px' },
},
zIndex: {
toast: '50',
modalDropdown: '50',
modal: '40',
sideModalDropdown: '40',
sideModal: '30',
modalOverlay: '25',
topBarDropdown: '20',
topBar: '15',
popover: '10',
contentDropdown: '10',
content: '0',
},
},
borderRadius: {
none: 0,
...borderRadiusTokens,
},
colors: {
transparent: 'transparent',
current: 'currentColor',
},
},
plugins: [
plugin(({ addVariant, addUtilities, variants }) => {
addVariant('children', '& > *')
addVariant('selected', '.is-selected &')
addVariant('disabled', ['&.visually-disabled', '&:disabled'])
addUtilities(
Array.from({ length: 12 }, (_, i) => i)
.map((i) => ({
[`.grid-col-${i}`]: {
'grid-column': `${i}`,
},
}))
.reduce((p, c) => ({ ...p, ...c }), {}),
variants
)
addUtilities(textUtilities)
addUtilities(colorUtilities)
addUtilities(elevationUtilities)
}),
],
}