2024-02-10 11:59:58 +00:00
|
|
|
module.exports = {
|
2024-02-12 08:25:11 +00:00
|
|
|
content: ["./web/templates/**/*.{tmpl,go}"],
|
2024-02-10 11:59:58 +00:00
|
|
|
theme: {
|
|
|
|
container: {
|
|
|
|
center: true,
|
|
|
|
},
|
|
|
|
extend: {},
|
|
|
|
},
|
2024-05-28 17:59:44 +00:00
|
|
|
plugins: [
|
|
|
|
// https://gist.github.com/Merott/d2a19b32db07565e94f10d13d11a8574
|
|
|
|
function ({ addBase, theme }) {
|
|
|
|
function extractColorVars(colorObj, colorGroup = "") {
|
|
|
|
return Object.keys(colorObj).reduce((vars, colorKey) => {
|
|
|
|
const value = colorObj[colorKey];
|
|
|
|
const cssVariable =
|
|
|
|
colorKey === "DEFAULT"
|
|
|
|
? `--color${colorGroup}`
|
|
|
|
: `--color${colorGroup}-${colorKey}`;
|
|
|
|
|
|
|
|
const newVars =
|
|
|
|
typeof value === "string"
|
|
|
|
? { [cssVariable]: value }
|
|
|
|
: extractColorVars(value, `-${colorKey}`);
|
|
|
|
|
|
|
|
return { ...vars, ...newVars };
|
|
|
|
}, {});
|
|
|
|
}
|
|
|
|
|
|
|
|
addBase({
|
|
|
|
":root": extractColorVars(theme("colors")),
|
|
|
|
});
|
|
|
|
},
|
|
|
|
],
|
2024-02-10 11:59:58 +00:00
|
|
|
};
|