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 }}"
|
href="{{ preload.href }}"
|
||||||
{% if preload.crossorigin %}crossorigin{% endif %} />
|
{% if preload.crossorigin %}crossorigin{% endif %} />
|
||||||
{% endfor %}
|
{% 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 %}
|
{% if youtube %}
|
||||||
<!-- youtube, if true in frontmatter -->
|
<!-- youtube, if true in frontmatter -->
|
||||||
<script type="module"
|
<script type="module"
|
||||||
|
|
|
@ -13,15 +13,22 @@ const autoprefixer = require("autoprefixer");
|
||||||
const cssnano = require("cssnano");
|
const cssnano = require("cssnano");
|
||||||
const path = require("path").posix;
|
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 {
|
module.exports = class {
|
||||||
async data() {
|
async data() {
|
||||||
const rawFilepath = path.join(__dirname, "./global.css");
|
const rawFilepath = path.join(__dirname, "./global.css");
|
||||||
const rawCss = fs.readFileSync(rawFilepath);
|
const rawCss = fs.readFileSync(rawFilepath);
|
||||||
|
|
||||||
|
const css = `${rawCss}${fontFamily}${fontVariables}${colors}${spacing}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
permalink: `css/styles.css`,
|
permalink: `css/styles.css`,
|
||||||
rawFilepath,
|
rawFilepath,
|
||||||
rawCss,
|
rawCss: css,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue