Fix: postcss config + checking that it works changing stuff in main.css

feature/oscar-theme
Óscar M. Lage 2022-01-20 01:14:20 +01:00
parent 05334d7887
commit 4278934bd6
3 changed files with 22 additions and 8 deletions

View File

@ -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 */

View File

@ -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]
}),
]
}

View File

@ -10,10 +10,9 @@
<title>{{- if .IsHome }}{{ .Site.Title }}{{- else }}{{ .Title }} &middot; {{ .Site.Title }}{{- end }}</title>
<!-- CSS -->
{{- $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 }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
<link rel="stylesheet" href="{{ "css/fonts.css" | relURL }}">
{{ range .Site.Params.css -}}