forked from regisphilibert/hugo-starter-tailwind-basic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtailwind.config.js
More file actions
28 lines (25 loc) · 832 Bytes
/
tailwind.config.js
File metadata and controls
28 lines (25 loc) · 832 Bytes
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
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' ],
mode: 'all',
options: {
//whitelist: [ 'pl-1', 'pl-3' ],
defaultExtractor: (content) => {
let els = JSON.parse(content).htmlElements;
els = els.tags.concat(els.classes, els.ids);
return els;
}
}
},
plugins: [ typography ]
};