-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.js
144 lines (144 loc) · 4.12 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
// module.exports = {
// purge: [],
// darkMode: false, // or 'media' or 'class'
// theme: {
// extend: {},
// },
// variants: {
// extend: {},
// },
// plugins: [],
// }
const plugin = require('tailwindcss/plugin')
const { orange, indigo } = require('tailwindcss/colors')
module.exports = {
purge: {
// enabled: true,
content: ['./src/**/*.vue'],
},
darkMode: false, // or 'media' or 'class'
theme: {
extend: {
colors: {
theme: indigo['300'],
red: {
60: '#fef0f0',
500: '#ee5050',
550: '#ef4444',
600: '#dd2b2b',
},
gray: {
60: '#f4f4f5',
200: '#e8ebf0',
550: '#667797',
600: '#566b96',
650: '#4b5563',
},
yellow: {
60: '#fdf6ec',
500: '#f6a517',
550: '#f59e0b',
600: '#e7a747',
},
orange,
},
zIndex: {
1: '1',
},
},
},
variants: {
extend: {
fontWeight: ['hover'],
},
},
plugins: [
plugin(function ({ addComponents, theme }) {
const buttons = {
'.btn': {
display: 'inline-block',
padding: `${theme('spacing[2.5]')} ${theme('spacing.5')}`,
lineHeight: 1,
fontSize: theme('fontSize.sm'),
fontWeight: theme('fontWeight.medium'),
borderWidth: '1px',
borderRadius: theme('borderRadius.DEFAULT'),
cursor: theme('cursor.pointer'),
transitionProperty: 'background-color, border-color, color,opacity',
transitionDuration: '120ms',
transitionTimingFunction: 'linear',
userSelect: 'none',
'white-space': 'nowrap',
'&[size="lg"]': {
padding: `${theme('spacing.3')} ${theme('spacing.6')}`,
},
'&[size="md"]': {
padding: `${theme('spacing[2.5]')} ${theme('spacing.5')}`,
},
'&[size="sm"]': {
padding: `${theme('spacing.[2.5]')} ${theme('spacing.[3.5]')}`,
fontSize: theme('fontSize.xs'),
},
'&[size="mini"]': {
padding: `${theme('spacing.[1.5]')} ${theme('spacing.[3.5]')}`,
fontSize: theme('fontSize.xs'),
},
'&[disable]': {
cursor: theme('cursor[not-allowed]'),
opacity: theme('opacity[50]'),
},
},
'.btn-danger': {
backgroundColor: theme('colors.red.600'),
color: theme('colors.white'),
borderColor: theme('colors.red.500'),
'&:not([disable])&:hover': {
backgroundColor: theme('colors.red.550'),
},
'&[plain]': {
color: theme('colors.red.600'),
backgroundColor: theme('colors.red.60'),
},
'&[plain]&:hover': {
color: theme('colors.white'),
backgroundColor: theme('colors.red.600'),
},
},
'.btn-info': {
backgroundColor: theme('colors.gray.600'),
color: theme('colors.white'),
borderColor: theme('colors.gray.500'),
'&:not([disable])&:hover': {
backgroundColor: theme('colors.gray.550'),
},
'&[plain]': {
color: theme('colors.gray.600'),
backgroundColor: theme('colors.gray.200'),
},
'&[plain]&:hover': {
color: theme('colors.white'),
backgroundColor: theme('colors.gray.500'),
// opacity: theme('opacity.50'),
},
},
'.btn-warning': {
backgroundColor: theme('colors.yellow.600'),
color: theme('colors.white'),
borderColor: theme('colors.yellow.500'),
'&:not([disable])&:hover': {
backgroundColor: theme('colors.yellow.550'),
},
'&[plain]': {
color: theme('colors.yellow.600'),
backgroundColor: theme('colors.yellow.60'),
},
'&[plain]&:hover': {
color: theme('colors.white'),
backgroundColor: theme('colors.yellow.600'),
},
},
}
addComponents(buttons)
}),
],
}