1
1
const colors = require ( 'tailwindcss/colors' )
2
2
3
+ const round = num =>
4
+ num
5
+ . toFixed ( 7 )
6
+ . replace ( / ( \. [ 0 - 9 ] + ?) 0 + $ / , '$1' )
7
+ . replace ( / \. 0 $ / , '' )
8
+ const rem = px => `${ round ( px / 16 ) } rem`
9
+
3
10
module . exports = {
4
11
plugins : [
5
12
require ( '@tailwindcss/line-clamp' ) ,
@@ -50,7 +57,7 @@ module.exports = {
50
57
300 : '#9f9893' ,
51
58
400 : '#877f7a' ,
52
59
500 : '#6f6762' ,
53
- 600 : '#57504c ' ,
60
+ 600 : '#574f4a ' ,
54
61
700 : '#3e3936' ,
55
62
800 : '#262220' ,
56
63
900 : '#0d0c0b'
@@ -164,65 +171,70 @@ module.exports = {
164
171
165
172
extend : {
166
173
typography : theme => ( {
167
- DEFAULT : { // prose
174
+ DEFAULT : {
168
175
css : {
176
+ color : theme ( 'colors.warmGray.600' ) ,
177
+ fontSize : rem ( 16 ) ,
178
+ lineHeight : rem ( 28 ) ,
169
179
maxWidth : null ,
170
180
171
181
a : {
172
182
color : theme ( 'colors.orange.700' )
173
183
} ,
174
184
175
185
p : {
176
- color : '#574F4A' ,
177
- fontFamily : 'Fira Sans' ,
178
- lineHeight : '28px' ,
179
- fontSize : '16px'
186
+ color : theme ( 'colors.warmGray.600' ) ,
187
+ fontFamily : theme ( 'fontFamily.sans' ) . join ( ',' ) ,
188
+ fontSize : rem ( 16 ) ,
189
+ lineHeight : rem ( 28 )
180
190
} ,
181
191
182
192
h1 : {
183
- color : '#574F4A' ,
184
- fontFamily : 'Fira Sans' ,
193
+ color : theme ( 'colors.warmGray.600' ) ,
194
+ fontFamily : theme ( 'fontFamily.sans' ) . join ( ',' ) ,
185
195
fontWeight : theme ( 'fontWeight.extralight' ) ,
186
- fontSize : '48px' ,
187
- lineHeight : '54px'
196
+ fontSize : rem ( 36 ) ,
197
+ lineHeight : rem ( 42 )
188
198
} ,
189
199
190
200
h2 : {
191
- color : '#574F4A' ,
192
- fontFamily : 'Roboto Slab, serif, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji' ,
201
+ color : theme ( 'colors.warmGray.600' ) ,
202
+ fontFamily : theme ( 'fontFamily. serif' ) . join ( ',' ) ,
193
203
fontWeight : theme ( 'fontWeight.normal' ) ,
194
- fontSize : '32px' ,
195
- lineHeight : '36px'
204
+ fontSize : rem ( 32 ) ,
205
+ lineHeight : rem ( 36 )
196
206
} ,
197
207
198
208
h3 : {
199
- color : '#574F4A' ,
200
- fontFamily : 'Roboto Slab, serif, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji' ,
209
+ color : theme ( 'colors.warmGray.600' ) ,
210
+ fontFamily : theme ( 'fontFamily. serif' ) . join ( ',' ) ,
201
211
fontWeight : theme ( 'fontWeight.normal' ) ,
202
- fontSize : '24px' ,
203
- lineHeight : '32px'
212
+ fontSize : rem ( 24 ) ,
213
+ lineHeight : rem ( 32 )
204
214
} ,
205
215
206
216
h4 : {
207
- color : '#574F4A' ,
208
- fontFamily : 'Roboto Slab, serif, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji' ,
217
+ color : theme ( 'colors.warmGray.600' ) ,
218
+ fontFamily : theme ( 'fontFamily. serif' ) . join ( ',' ) ,
209
219
fontWeight : theme ( 'fontWeight.bold' ) ,
210
- fontSize : '20px' ,
211
- lineHeight : '24px'
220
+ fontSize : rem ( 20 ) ,
221
+ lineHeight : rem ( 24 )
212
222
} ,
213
223
214
224
h5 : {
215
- fontFamily : 'Roboto Slab, serif, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji' ,
225
+ color : theme ( 'colors.warmGray.600' ) ,
226
+ fontFamily : theme ( 'fontFamily.serif' ) . join ( ',' ) ,
216
227
fontWeight : theme ( 'fontWeight.bold' ) ,
217
- fontSize : '18px' ,
218
- lineHeight : '20px'
228
+ fontSize : rem ( 18 ) ,
229
+ lineHeight : rem ( 20 )
219
230
} ,
220
231
221
232
h6 : {
222
- fontFamily : 'Roboto Slab, serif, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji' ,
233
+ color : theme ( 'colors.warmGray.600' ) ,
234
+ fontFamily : theme ( 'fontFamily.serif' ) . join ( ',' ) ,
223
235
fontWeight : theme ( 'fontWeight.bold' ) ,
224
- fontSize : '16px' ,
225
- lineHeight : '20px'
236
+ fontSize : rem ( 16 ) ,
237
+ lineHeight : rem ( 20 )
226
238
} ,
227
239
228
240
'blockquote p:first-of-type::before' : {
@@ -249,7 +261,7 @@ module.exports = {
249
261
backgroundColor : theme ( 'colors.gray.800' ) ,
250
262
borderRadius : theme ( 'borderRadius.DEFAULT' ) ,
251
263
color : theme ( 'colors.gray.100' ) ,
252
- fontWeight : '400' ,
264
+ fontWeight : theme ( 'fontWeight.normal' ) ,
253
265
padding : theme ( 'spacing.2' )
254
266
} ,
255
267
@@ -275,81 +287,81 @@ module.exports = {
275
287
}
276
288
} ,
277
289
278
- sm : { // // prose-sm
290
+ sm : {
279
291
css : {
280
- fontSize : '18px' ,
281
- lineHeight : '32px' ,
292
+ fontSize : rem ( 18 ) ,
293
+ lineHeight : rem ( 32 ) ,
282
294
283
295
p : {
284
- fontSize : '18px' ,
285
- lineHeight : '32px'
296
+ fontSize : rem ( 18 ) ,
297
+ lineHeight : rem ( 32 )
286
298
} ,
287
299
288
300
h1 : {
289
- fontSize : '42px' ,
290
- lineHeight : '48px'
301
+ fontSize : rem ( 42 ) ,
302
+ lineHeight : rem ( 48 )
291
303
} ,
292
304
293
305
h2 : {
294
- fontSize : '36px' ,
295
- lineHeight : '42px'
306
+ fontSize : rem ( 36 ) ,
307
+ lineHeight : rem ( 42 )
296
308
} ,
297
309
298
310
h3 : {
299
- fontSize : '28px' ,
300
- lineHeight : '36px'
311
+ fontSize : rem ( 28 ) ,
312
+ lineHeight : rem ( 36 )
301
313
} ,
302
314
303
315
h4 : {
304
- fontSize : '24px' ,
305
- lineHeight : '28px'
316
+ fontSize : rem ( 24 ) ,
317
+ lineHeight : rem ( 28 )
306
318
} ,
307
319
308
320
h5 : {
309
- fontSize : '20px' ,
310
- lineHeight : '24px'
321
+ fontSize : rem ( 20 ) ,
322
+ lineHeight : rem ( 24 )
311
323
}
312
324
}
313
325
} ,
314
326
315
- xl : { // prose-xl
327
+ xl : {
316
328
css : {
317
- fontSize : '20px' ,
318
- lineHeight : '36px' ,
329
+ fontSize : rem ( 20 ) ,
330
+ lineHeight : rem ( 36 ) ,
319
331
320
332
p : {
321
- fontSize : '20px' ,
322
- lineHeight : '36px'
333
+ fontSize : rem ( 20 ) ,
334
+ lineHeight : rem ( 36 )
323
335
} ,
324
336
325
337
h1 : {
326
- fontSize : '48px' ,
327
- lineHeight : '54px'
338
+ fontSize : rem ( 48 ) ,
339
+ lineHeight : rem ( 54 )
328
340
} ,
329
341
330
342
h2 : {
331
- fontSize : '40px' ,
332
- lineHeight : '48px'
343
+ fontSize : rem ( 40 ) ,
344
+ lineHeight : rem ( 48 )
333
345
} ,
334
346
335
347
h3 : {
336
- fontSize : '32px' ,
337
- lineHeight : '40px'
348
+ fontSize : rem ( 32 ) ,
349
+ lineHeight : rem ( 40 )
338
350
} ,
339
351
340
352
h4 : {
341
- fontSize : '28px' ,
342
- lineHeight : '32px'
353
+ fontSize : rem ( 28 ) ,
354
+ lineHeight : rem ( 32 )
343
355
} ,
344
356
345
357
h5 : {
346
- fontSize : '24px' ,
347
- lineHeight : '28px'
358
+ fontSize : rem ( 24 ) ,
359
+ lineHeight : rem ( 28 )
348
360
} ,
349
361
350
362
h6 : {
351
- fontSize : '20px' ,
352
- lineHeight : '24px'
363
+ fontSize : rem ( 20 ) ,
364
+ lineHeight : rem ( 24 )
353
365
}
354
366
}
355
367
}
0 commit comments