-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathtailwind.config.js
216 lines (202 loc) · 6.72 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
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
213
214
215
216
// @ts-check
// const colors = require('tailwindcss/colors')
// helpers for @tailwindcss/typography styles
// see: https://github.com/tailwindlabs/tailwindcss-typography/blob/master/src/styles.js
/** @type {(num: number) => string} */
const round = (num) =>
num
.toFixed(7)
.replace(/(\.[0-9]+?)0+$/, '$1')
.replace(/\.0$/, '')
/** @type {(px: number) => string} */
// const rem = (px) => `${round(px / 16)}rem`
/** @type {(px: number, base: number) => string} */
const em = (px, base) => `${round(px / base)}em`
/** @type {import('tailwindcss').Config} */
const config = {
// Remove unused classes in prod to decrease the size of the CSS bundle
content: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'],
theme: {
extend: {
colors: {
// we can also use tailwind's other palettes, such as coolGray for text
navy: {
900: '#051E5E',
800: '#082B76',
700: '#09328B',
600: '#224BA4',
500: '#4362A6',
400: '#8B9FC8',
300: '#C5CFE4',
200: '#DEE5F4',
100: '#EEF4FD',
50: '#F8FAFE',
},
purple: {
500: '#8F97E5',
400: '#9FA8FF',
300: '#B6BCFF',
200: '#CCD1FF',
100: '#E3E5FF',
50: '#EEF0FF',
},
rosemary: {
900: '#523261',
800: '#734973',
500: '#A284B0',
400: '#B493C4',
300: '#C6ACD2',
200: '#D7C6E0',
100: '#E9DFEE',
50: '#F2ECF5',
},
turquoise: {
500: '#79D2E3',
400: '#87E9FC',
300: '#A8EFFD',
200: '#C8F5FE',
100: '#DEF9FE',
50: '#E9FBFE',
},
beige: {
500: '#E5DBCE',
400: '#FFF3E5',
300: '#FFF6EB',
200: '#FFF9F1',
100: '#FFFBF7',
50: '#FFFDFA',
},
},
width: {
'6/5': '120%',
},
minHeight: {
/**
* Viewport height minus the header height
*/
content: 'calc(100vh - 4rem)',
},
height: {
/**
* Height of the navigation at the top of the page
*/
nav: '4rem',
/**
* Viewport height minus the header height
*/
content: 'calc(100vh - 4rem)',
'screen/2': '50vh',
'screen/3': '33vh',
},
fontFamily: {
sans: [
'Lato',
'ui-sans-serif',
'system-ui',
'-apple-system',
'BlinkMacSystemFont',
'"Segoe UI"',
'Roboto',
'"Helvetica Neue"',
'Arial',
'"Noto Sans"',
'sans-serif',
'"Apple Color Emoji"',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
'"Noto Color Emoji"',
],
},
boxShadow: {
sm: '0px 1px 2px 0px #000000 5%',
DEFAULT:
'0px 1px 2px 0px #000000 6%, box-shadow: 0px 1px 3px 0px #000000 10%',
md: '0px 1px 2px 0px #000000 6%, box-shadow: 0px 1px 3px 0px #000000 10%',
lg: '0px 4px 6px -2px #000000 5%, 0px 10px 15px -3px #000000 10%',
},
// unfortunately @tailwindcss/typeography doesn't ship types
/** @ts-ignore */
typography: ({ theme }) => ({
// docs: https://tailwindcss.com/docs/typography-plugin#customizing-the-css
// code: https://github.com/tailwindlabs/tailwindcss-typography/blob/master/src/styles.js
DEFAULT: {
css: {
h1: {
fontSize: em(54, 16),
marginTop: '0',
marginBottom: em(48, 54),
lineHeight: round(67.5 / 54),
textTransform: 'uppercase',
},
h2: {
fontSize: em(36, 16),
marginTop: em(64, 36),
marginBottom: em(36, 36),
lineHeight: round(48 / 36),
},
'h2:first-child': {
marginTop: 0,
},
h3: {
fontSize: em(20, 16),
marginTop: em(32, 20),
marginBottom: em(12, 20),
lineHeight: round(32 / 20),
},
'h3:first-child': {
marginTop: 0,
},
'--tw-prose-body': theme('colors.gray[800]'),
'--tw-prose-headings': theme('colors.navy[700]'),
'--tw-prose-lead': theme('colors.gray[600]'),
'--tw-prose-links': theme('colors.navy[900]'),
'--tw-prose-bold': theme('colors.navy[600]'),
'--tw-prose-counters': theme('colors.gray[500]'),
'--tw-prose-bullets': theme('colors.gray[800]'),
'--tw-prose-hr': theme('colors.gray[200]'),
'--tw-prose-quotes': theme('colors.gray[900]'),
'--tw-prose-quote-borders': theme('colors.gray[200]'),
'--tw-prose-captions': theme('colors.gray[500]'),
'--tw-prose-code': theme('colors.gray[900]'),
'--tw-prose-pre-code': theme('colors.gray[200]'),
'--tw-prose-pre-bg': theme('colors.gray[800]'),
'--tw-prose-th-borders': theme('colors.gray[300]'),
'--tw-prose-td-borders': theme('colors.gray[200]'),
'--tw-prose-invert-body': theme('colors.gray[300]'),
'--tw-prose-invert-headings': theme('colors.white'),
'--tw-prose-invert-lead': theme('colors.gray[400]'),
'--tw-prose-invert-links': theme('colors.white'),
'--tw-prose-invert-bold': theme('colors.white'),
'--tw-prose-invert-counters': theme('colors.gray[400]'),
'--tw-prose-invert-bullets': theme('colors.gray[600]'),
'--tw-prose-invert-hr': theme('colors.gray[700]'),
'--tw-prose-invert-quotes': theme('colors.gray[100]'),
'--tw-prose-invert-quote-borders': theme('colors.gray[700]'),
'--tw-prose-invert-captions': theme('colors.gray[400]'),
'--tw-prose-invert-code': theme('colors.white'),
'--tw-prose-invert-pre-code': theme('colors.gray[300]'),
'--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)',
'--tw-prose-invert-th-borders': theme('colors.gray[600]'),
'--tw-prose-invert-td-borders': theme('colors.gray[700]'),
},
},
}),
},
},
variants: {
extend: {
// Adds the ability to style the first and last child.
// For example: first:pl-4
padding: ['first', 'last'],
// Adds the ability to set the background color on the active state
// For example: active:bg-green-700
backgroundColor: ['active', 'even', 'odd'],
},
},
plugins: [
require('@tailwindcss/forms'),
require('@tailwindcss/line-clamp'),
require('@tailwindcss/typography'),
],
}
module.exports = config