-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.js
93 lines (87 loc) · 2.64 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
const plugin = require('tailwindcss/plugin')
const tailwindTheme = {
borderRadius: require('./tokens/dist/tailwind/rounded'),
boxShadow: require('./tokens/dist/tailwind/boxShadow'),
fontSize: require('./tokens/dist/tailwind/fontSize'),
lineHeight: require('./tokens/dist/tailwind/space'),
screens: require('./tokens/dist/tailwind/breakpoints'),
spacing: require('./tokens/dist/tailwind/space'),
zIndex: require('./tokens/dist/tailwind/zIndex'),
colors: {
...require('./tokens/dist/tailwind/color'),
'transparent': 'transparent'
}
}
const tailwindCorePluginsColor = ['backgroundColor', 'borderColor', 'textColor']
tailwindCorePluginsColor.forEach(corePlugin => {
tailwindTheme[corePlugin] = {
...tailwindTheme.colors,
...require(`./tokens/dist/tailwind/${corePlugin}`)
}
})
tailwindTheme.extend = {
flexShrink: {
2: '2'
},
animation: {
busy: 'busy 1.5s linear infinite',
},
keyframes: {
busy: {
'from': { 'background-position': '0 0' },
'to': { 'background-position': '30px 30px' },
},
},
}
module.exports = {
content: [
'./tokens/*.mdx',
'./src/components/**/*.{js,vue}',
'./src/directives/**/*.js',
'./.storybook/**/*.jsx'
],
plugins: [
plugin(function({ addBase, addUtilities }) {
addBase({
html: {
'color': require('./tokens/dist/tailwind/textColor').default,
}
})
addUtilities({
/**
* This overrides the Tailwind class of the same name with some
* styles to ensure browsers are adding hyphens if appropriate.
*/
'.break-words': {
'word-wrap': 'break-word',
'word-break': 'break-word',
'hyphens': 'auto'
},
/**
* Hide scrollbar while keeping the element scrollable.
* See https://stackoverflow.com/a/63756377/6234391
*/
'.scrollbar-none': {
'scrollbar-width': 'none',
'&::-webkit-scrollbar': {
'display': 'none'
}
},
/**
* Visualize indeterminate system action. Use in conjunction with "animate-busy".
*/
'.bg-busy': {
'background-image': 'linear-gradient(135deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent)',
'background-size': '60px 60px'
},
/**
* Visualize invalid input elements. Applied by dpValidateMixin.
*/
'.is-invalid': {
'@apply outline-interactive-warning border-interactive-warning': {},
}
})
})
],
theme: tailwindTheme
}