forked from bep/hugo-starter-tailwind-basic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.js
33 lines (29 loc) · 878 Bytes
/
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
const theme = require('tailwindcss/defaultTheme');
const typography = require('@tailwindcss/typography');
//const colorBrand = 'var(--color-pretty)';
// Utils
const round = (num) => num.toFixed(7).replace(/(\.[0-9]+?)0+$/, '$1').replace(/\.0$/, '');
const rem = (px) => `${round(px / 16)}rem`;
const em = (px, base) => `${round(px / base)}em`;
const px = (px) => `${px}px`;
module.exports = {
important: true, // See https://tailwindcss.com/docs/configuration#important
purge: {
enabled: process.env.HUGO_ENVIRONMENT === 'production',
content: [
'./hugo_stats.json',
'./layouts/**/*.html',
],
extractors: [
{
extractor: (content) => {
let els = JSON.parse(content).htmlElements;
return els.tags.concat(els.classes, els.ids);
},
extensions: ['json']
},
],
mode: 'all',
},
plugins: [ typography ]
};