add theme installer page

This commit is contained in:
SethBurkart123
2024-04-09 19:34:28 +10:00
parent bbb11c91b7
commit 8c06ea1ec1
8 changed files with 394 additions and 10 deletions
+18 -2
View File
@@ -1,3 +1,8 @@
const colors = require("tailwindcss/colors");
const {
default: flattenColorPalette,
} = require("tailwindcss/lib/util/flattenColorPalette");
/** @type {import('tailwindcss').Config} */
export default {
content: [
@@ -35,5 +40,16 @@ export default {
}
}
},
plugins: [],
};
plugins: [addVariablesForColors],
};
function addVariablesForColors({ addBase, theme }) {
let allColors = flattenColorPalette(theme("colors"));
let newVars = Object.fromEntries(
Object.entries(allColors).map(([key, val]) => [`--${key}`, val])
);
addBase({
":root": newVars,
});
}