32 lines
922 B
JavaScript
32 lines
922 B
JavaScript
/*
|
|
* Implementation sourced from eleventyone starter kit
|
|
* https://github.com/philhawksworth/eleventyone
|
|
* ---
|
|
* https://github.com/philhawksworth/eleventyone/blob/master/src/site/css/styles.11ty.js
|
|
*/
|
|
import fs from "node:fs";
|
|
import postcss from "postcss";
|
|
import cssnano from "cssnano";
|
|
|
|
import colors from "./src/colors.js";
|
|
import fontFamily from "./src/font-family.js";
|
|
import fontVariables from "./src/font-variables.js";
|
|
import spacing from "./src/spacing.js";
|
|
|
|
async function generateCSS() {
|
|
const css = `${fontFamily}${fontVariables}${colors}${spacing}`;
|
|
await postcss([cssnano])
|
|
.process(css, {
|
|
from: undefined,
|
|
to: "dist/lilypad.css",
|
|
})
|
|
.then((result) => {
|
|
fs.mkdirSync("dist");
|
|
fs.writeFileSync("dist/lilypad.css", result.css);
|
|
if (result.map) {
|
|
fs.writeFile("dest/app.css.map", result.map.toString(), () => true);
|
|
}
|
|
});
|
|
}
|
|
|
|
generateCSS();
|