Converting from sass to nested vanilla css with layers (#147)
This commit is contained in:
parent
8e611f3a64
commit
57244c3f33
2 changed files with 2687 additions and 2751 deletions
|
|
@ -5,7 +5,7 @@
|
|||
{{ $opts = merge $opts (dict "minify" false) -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ $early := resources.Get "js/script-early.js" | js.Build $opts | fingerprint -}}
|
||||
{{ $early := resources.Get "js/script-early.js" | js.Build $opts -}}
|
||||
<script>
|
||||
{{ $early.Content | safeJS }}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,12 @@
|
|||
{{ $main_options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" false "transpiler" (site.Params.sassTranspiler | default "libsass")) -}}
|
||||
{{ if eq hugo.Environment "development" -}}
|
||||
{{ $main_options = merge $main_options (dict "outputStyle" "nested" "enableSourceMap" true) -}}
|
||||
{{ end -}}
|
||||
{{ $mobile_options := merge $main_options (dict "targetPath" "css/mobilemenu.css") -}}
|
||||
{{ $print_options := merge $main_options (dict "targetPath" "css/print.css") -}}
|
||||
{{ $main_style := resources.Get "sass/styles.scss" | toCSS $main_options -}}
|
||||
{{ $mobile_style := resources.Get "sass/mobilemenu.scss" | toCSS $mobile_options -}}
|
||||
{{ $print_style := resources.Get "sass/print.scss" | toCSS $print_options -}}
|
||||
{{ $main_style := resources.Match "css/_*.css" | append (resources.Match "css/**/_*.css") | resources.Concat "css/styles.css" -}}
|
||||
{{ $mobile_style := resources.Get "css/mobilemenu.css" -}}
|
||||
{{ $print_style := resources.Get "css/print.css" -}}
|
||||
{{ if ne hugo.Environment "development" -}}
|
||||
{{ $main_style = $main_style | fingerprint -}}
|
||||
{{ $mobile_style = $mobile_style | fingerprint -}}
|
||||
{{ $print_style = $print_style | fingerprint -}}
|
||||
{{ $main_style = $main_style | minify | fingerprint -}}
|
||||
{{ $mobile_style = $mobile_style | minify | fingerprint -}}
|
||||
{{ $print_style = $print_style | minify | fingerprint -}}
|
||||
{{ end -}}
|
||||
{{ with resources.Get "css/layers-init.css" }}<style>{{ .Content | safeCSS }}</style>{{ end }}
|
||||
<link rel="stylesheet" href="{{ $main_style.RelPermalink }}">
|
||||
{{ if $.Param "mobilemenu" -}}
|
||||
<link rel="stylesheet" href="{{ $mobile_style.RelPermalink }}" media="screen">
|
||||
|
|
|
|||
Loading…
Reference in a new issue