-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.js
38 lines (36 loc) · 1.09 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
/** @type {import('tailwindcss').Config} */
const plugin = require("tailwindcss/plugin");
const defaultConfigs = require("./src/config/default");
const spacingCalculator = require("./src/lib/spacing-calculator");
const fontSizeCalculator = require("./src/lib/font-size-calculator");
const { extendedColors, extendedBoxShadows } = require("./src/extend");
module.exports = {
content: [{ raw: "" }],
plugins: [
plugin.withOptions(
(options) => {
const settings = { ...defaultConfigs, ...options };
return ({ addBase }) => {
addBase({
html: { fontSize: `${(settings.baseFontSize * 100) / 16}%` },
});
};
},
(options) => {
const settings = { ...defaultConfigs, ...options };
const spacing = spacingCalculator(settings);
const fontSize = fontSizeCalculator(settings);
return {
theme: {
spacing,
fontSize,
extend: {
colors: extendedColors,
boxShadow: extendedBoxShadows,
},
},
};
}
),
],
};