feat: move css builder to styles.11ty.js
This commit is contained in:
parent
aba6504193
commit
5ca157c65a
2 changed files with 8 additions and 8 deletions
|
@ -17,13 +17,6 @@
|
|||
href="{{ preload.href }}"
|
||||
{% if preload.crossorigin %}crossorigin{% endif %} />
|
||||
{% endfor %}
|
||||
{% set css %}
|
||||
{% include "css/colorVariables.njk" %}
|
||||
{% include "css/fontFace.njk" %}
|
||||
{% include "css/fontVariables.njk" %}
|
||||
{% include "css/spacing.njk" %}
|
||||
{% endset %}
|
||||
<style>{{ css | minifyCss | safe }}</style>
|
||||
{% if youtube %}
|
||||
<!-- youtube, if true in frontmatter -->
|
||||
<script type="module"
|
||||
|
|
|
@ -13,15 +13,22 @@ const autoprefixer = require("autoprefixer");
|
|||
const cssnano = require("cssnano");
|
||||
const path = require("path").posix;
|
||||
|
||||
const colors = require("../css-utils/colors");
|
||||
const fontFamily = require("../css-utils/font-family");
|
||||
const fontVariables = require("../css-utils/font-variables");
|
||||
const spacing = require("../css-utils/spacing");
|
||||
|
||||
module.exports = class {
|
||||
async data() {
|
||||
const rawFilepath = path.join(__dirname, "./global.css");
|
||||
const rawCss = fs.readFileSync(rawFilepath);
|
||||
|
||||
const css = `${rawCss}${fontFamily}${fontVariables}${colors}${spacing}`;
|
||||
|
||||
return {
|
||||
permalink: `css/styles.css`,
|
||||
rawFilepath,
|
||||
rawCss,
|
||||
rawCss: css,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue