Skip to content

Commit

Permalink
fix: better postcss rules
Browse files Browse the repository at this point in the history
update safelist after upgrading purgecss,
making css size reduce from 160kB to 55kB
  • Loading branch information
wlh320 committed Jul 26, 2024
1 parent 6e1c498 commit 16359c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@
{{- end }}
{{- if .Site.Params.postcss }}
{{- $bulma := $bulmaCss | postCSS | resources.Minify | resources.PostProcess }}
{{- $hulga := $hulgaScss | resources.ExecuteAsTemplate "css/hulga.scss" . | resources.ToCSS $options | postCSS | resources.Minify | resources.PostProcess }}
<link rel="stylesheet" type="text/css" href="{{ $bulma.RelPermalink }}">
<link rel="stylesheet" type="text/css" href="{{ $hulga.RelPermalink }}">
{{- else }}
{{- $bulma := $bulmaCss | resources.Minify }}
{{- $hulga := $hulgaScss | resources.ExecuteAsTemplate "css/hulga.scss" . | resources.ToCSS $options | resources.Minify }}
<link rel="stylesheet" type="text/css" href="{{ $bulma.Permalink | relURL }}">
<link rel="stylesheet" type="text/css" href="{{ $hulga.Permalink | relURL }}">
<link rel="stylesheet" type="text/css" href="{{ $bulma.RelPermalink }}">
{{- end }}
{{- $hulga := $hulgaScss | resources.ExecuteAsTemplate "css/hulga.scss" . | resources.ToCSS $options | resources.Minify }}
<link rel="stylesheet" type="text/css" href="{{ $hulga.RelPermalink }}">
{{- if .Site.Params.pwa }}
<link rel="manifest" href="/manifest.json">
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
deep: [/^content/, /^chroma/],
greedy: [],
keyframes: [],
variables: [/control/, /pagination/, /family/, /text/, /link/, /selected/, /primary/]
variables: [/bulma-primary-100-l/, /bulma-primary-invert/]
}
},
autoprefixer: {},
Expand Down

0 comments on commit 16359c5

Please sign in to comment.