From 4278934bd60178f1b1c889711efff4cf14c89b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=CC=81scar=20M=2E=20Lage?= Date: Thu, 20 Jan 2022 01:14:20 +0100 Subject: [PATCH] Fix: postcss config + checking that it works changing stuff in main.css --- src/themes/oscar/assets/css/main.css | 8 ++++---- src/themes/oscar/assets/css/postcss.config.js | 15 +++++++++++++++ src/themes/oscar/layouts/partials/metas.html | 7 +++---- 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 src/themes/oscar/assets/css/postcss.config.js diff --git a/src/themes/oscar/assets/css/main.css b/src/themes/oscar/assets/css/main.css index 80eaee1..87f2f72 100644 --- a/src/themes/oscar/assets/css/main.css +++ b/src/themes/oscar/assets/css/main.css @@ -1,8 +1,8 @@ /* Basic */ -/* @import 'https://fonts.googleapis.com/css2?family=Overpass+Mono:wght@400;700&display=swap'; -@import 'normalize.css'; -@import 'variables.css'; -@import 'common.css'; */ +@import 'https://fonts.googleapis.com/css2?family=Overpass+Mono:wght@400;700&display=swap'; +@import 'assets/css/normalize.css'; +@import 'assets/css/variables.css'; +@import 'assets/css/common.css'; /* Layout */ diff --git a/src/themes/oscar/assets/css/postcss.config.js b/src/themes/oscar/assets/css/postcss.config.js new file mode 100644 index 0000000..967fd80 --- /dev/null +++ b/src/themes/oscar/assets/css/postcss.config.js @@ -0,0 +1,15 @@ +const themeDir = __dirname + '/../../'; + +module.exports = { + plugins: [ + require('postcss-import')({ + path: [themeDir] + }), + require('postcss-custom-media')({ + path: [themeDir] + }), + require('postcss-nested')({ + path: [themeDir] + }), + ] +} diff --git a/src/themes/oscar/layouts/partials/metas.html b/src/themes/oscar/layouts/partials/metas.html index d9bee3c..2096cfe 100644 --- a/src/themes/oscar/layouts/partials/metas.html +++ b/src/themes/oscar/layouts/partials/metas.html @@ -10,10 +10,9 @@ {{- if .IsHome }}{{ .Site.Title }}{{- else }}{{ .Title }} · {{ .Site.Title }}{{- end }} - {{- $inServerMode := .Site.IsServer }} - {{- $cssTarget := "css/style.css" }} - {{- $cssOptions := cond ($inServerMode) (dict "targetPath" $cssTarget "enableSourceMap" true) (dict "targetPath" $cssTarget "outputStyle" "compressed") }} - {{- $style := resources.Get "css/main.css" | toCSS $cssOptions }} + {{- $inServerMode := .Site.IsServer }} + {{ $options := dict "config" "assets/css/postcss.config.js" }} + {{ $style := resources.Get "css/main.css" | resources.PostCSS $options }} {{ range .Site.Params.css -}}