forked from noxify/gridsome-starter-casper-v2
-
Notifications
You must be signed in to change notification settings - Fork 3
/
tailwind.config.js
137 lines (130 loc) · 3.79 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
//tailwind border color plugin powered by
//https://github.com/tailwindcss/tailwindcss/pull/560#issuecomment-503222143
var _ = require('lodash')
var flattenColorPalette = require('tailwindcss/lib/util/flattenColorPalette').default
module.exports = {
purge: ["./src/**/*.html", "./src/**/*.vue", "./src/**/*.jsx"],
theme: {
stroke: theme => ({
'current': 'currentColor',
'white': theme('colors.white'),
'red': theme('colors.red.500'),
'green': theme('colors.green.500'),
'blue': theme('colors.blue.500')
}),
flex: {
'1': '1 1 0%',
auto: '1 1 auto',
initial: '0 1 auto',
none: 'none',
'post': '1 1 300px',
},
zIndex: {
'-10': '-10',
},
container : {
'xl' : 1024
},
extend: {}
},
variants: {},
corePlugins: {
container: false
},
plugins: [
function ({
addUtilities,
e,
theme,
variants
}) {
const colors = flattenColorPalette(theme('borderColor'))
const utilities = _.flatMap(_.omit(colors, 'default'), (value, modifier) => ({
[`.${e(`border-t-${modifier}`)}`]: {
borderTopColor: `${value}`
},
[`.${e(`border-r-${modifier}`)}`]: {
borderRightColor: `${value}`
},
[`.${e(`border-b-${modifier}`)}`]: {
borderBottomColor: `${value}`
},
[`.${e(`border-l-${modifier}`)}`]: {
borderLeftColor: `${value}`
},
}))
addUtilities(utilities, variants('borderColor'))
},
function ({
addComponents
}) {
addComponents({
'.container': {
maxWidth: '100%',
'@screen sm': {
maxWidth: '640px',
},
'@screen md': {
maxWidth: '768px',
},
'@screen lg': {
maxWidth: '1024px',
},
'@screen xl': {
maxWidth: '1024px',
},
}
})
},
function ({
addBase,
config
}) {
addBase({
'h1': {
fontSize: config('theme.fontSize.5xl'),
fontWeight: config('theme.fontWeight.bold'),
fontFamily: config('theme.fontFamily.sans').join(', '),
marginTop: config('theme.margin.4'),
marginBottom: config('theme.margin.4')
},
'h2': {
fontSize: config('theme.fontSize.4xl'),
fontWeight: config('theme.fontWeight.bold'),
fontFamily: config('theme.fontFamily.sans').join(', '),
marginTop: config('theme.margin.4'),
marginBottom: config('theme.margin.4')
},
'h3': {
fontSize: config('theme.fontSize.3xl'),
fontWeight: config('theme.fontWeight.bold'),
fontFamily: config('theme.fontFamily.sans').join(', '),
marginTop: config('theme.margin.4'),
marginBottom: config('theme.margin.4')
},
'h4': {
fontSize: config('theme.fontSize.2xl'),
fontWeight: config('theme.fontWeight.bold'),
fontFamily: config('theme.fontFamily.sans').join(', '),
marginTop: config('theme.margin.4'),
marginBottom: config('theme.margin.4')
},
'h5': {
fontSize: config('theme.fontSize.xl'),
fontWeight: config('theme.fontWeight.bold'),
fontFamily: config('theme.fontFamily.sans').join(', '),
marginTop: config('theme.margin.4'),
marginBottom: config('theme.margin.4')
},
'h6': {
fontSize: config('theme.fontSize.lg'),
fontWeight: config('theme.fontWeight.bold'),
fontFamily: config('theme.fontFamily.sans').join(', '),
marginTop: config('theme.margin.4'),
marginBottom: config('theme.margin.4')
},
})
},
require('tailwindcss-tables')()
]
}