mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 10:50:24 +00:00
variant: fix :root nesting selector for modified variants #974
This commit is contained in:
parent
f1701957c3
commit
ec88e24f46
2 changed files with 8 additions and 8 deletions
|
@ -60,11 +60,11 @@ Generator run:
|
||||||
{{- $formathtml = print $formathtml
|
{{- $formathtml = print $formathtml
|
||||||
"\n:root:not([data-r-output-format='print'])[data-r-theme-variant='" $themevariant.identifier "'] {"
|
"\n:root:not([data-r-output-format='print'])[data-r-theme-variant='" $themevariant.identifier "'] {"
|
||||||
"\n@media screen and (prefers-color-scheme: light) {"
|
"\n@media screen and (prefers-color-scheme: light) {"
|
||||||
"\n&" $lightthemevariant.themecontent
|
"\n" $lightthemevariant.themecontent
|
||||||
"\n" $lightthemevariant.chromacontent
|
"\n" $lightthemevariant.chromacontent
|
||||||
"\n}"
|
"\n}"
|
||||||
"\n@media screen and (prefers-color-scheme: dark) {"
|
"\n@media screen and (prefers-color-scheme: dark) {"
|
||||||
"\n&" $darkthemevariant.themecontent
|
"\n" $darkthemevariant.themecontent
|
||||||
"\n" $darkthemevariant.chromacontent
|
"\n" $darkthemevariant.chromacontent
|
||||||
"\n}"
|
"\n}"
|
||||||
"\n}"
|
"\n}"
|
||||||
|
@ -76,7 +76,7 @@ Generator run:
|
||||||
}}
|
}}
|
||||||
{{- $formathtml = print $formathtml
|
{{- $formathtml = print $formathtml
|
||||||
"\n:root:not([data-r-output-format='print'])[data-r-theme-variant='" $themevariant.identifier "'] {"
|
"\n:root:not([data-r-output-format='print'])[data-r-theme-variant='" $themevariant.identifier "'] {"
|
||||||
"\n&" $themevariant.themecontent
|
"\n" $themevariant.themecontent
|
||||||
"\n" $themevariant.chromacontent
|
"\n" $themevariant.chromacontent
|
||||||
"\n}"
|
"\n}"
|
||||||
}}
|
}}
|
||||||
|
@ -180,7 +180,7 @@ Generator run:
|
||||||
$formathtml
|
$formathtml
|
||||||
"\n}"
|
"\n}"
|
||||||
"\n@media print {"
|
"\n@media print {"
|
||||||
"\n&" $defaultthemevariant.themecontent
|
"\n" $defaultthemevariant.themecontent
|
||||||
"\n" $defaultthemevariant.chromacontent
|
"\n" $defaultthemevariant.chromacontent
|
||||||
"\n}"
|
"\n}"
|
||||||
"\n@media print {"
|
"\n@media print {"
|
||||||
|
@ -199,7 +199,7 @@ Generator run:
|
||||||
*/}}
|
*/}}
|
||||||
{{- $printcontent = print
|
{{- $printcontent = print
|
||||||
":root[data-r-output-format='print'] {"
|
":root[data-r-output-format='print'] {"
|
||||||
"\n&" $defaultthemevariant.themecontent
|
"\n" $defaultthemevariant.themecontent
|
||||||
"\n" $defaultthemevariant.chromacontent
|
"\n" $defaultthemevariant.chromacontent
|
||||||
"\n}"
|
"\n}"
|
||||||
"\n" $printcontent
|
"\n" $printcontent
|
||||||
|
@ -217,7 +217,7 @@ Generator run:
|
||||||
{{- $identifier := .identifier }}
|
{{- $identifier := .identifier }}
|
||||||
{{- $themecontent := "" }}
|
{{- $themecontent := "" }}
|
||||||
{{- with resources.Get (printf "css/theme-%s.css" $identifier) }}
|
{{- with resources.Get (printf "css/theme-%s.css" $identifier) }}
|
||||||
{{- $themecontent = .Content }}
|
{{- $themecontent = replaceRE `([ \t]*)(:root)` "${1}&${2}" .Content }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- errorf "\"theme-%s.css\": file not found in \"assets/css\"; if you are migrating from a theme version older thant 6.0.0, you have to move it over from \"static/css\"" $identifier }}
|
{{- errorf "\"theme-%s.css\": file not found in \"assets/css\"; if you are migrating from a theme version older thant 6.0.0, you have to move it over from \"static/css\"" $identifier }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -235,7 +235,7 @@ Generator run:
|
||||||
{{- $chroma = $themevariant.chroma }}
|
{{- $chroma = $themevariant.chroma }}
|
||||||
{{- $chromacontent = $themevariant.chromacontent }}
|
{{- $chromacontent = $themevariant.chromacontent }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $themecontent = $tempthemecontent}}
|
{{- $themecontent = replaceRE `(&\s*)+:root` "&:root" $tempthemecontent }}
|
||||||
{{- range findRESubmatch `[ \t]*--CODE-theme\s*:\s*([^;]*?)\s*;` $themecontent }}
|
{{- range findRESubmatch `[ \t]*--CODE-theme\s*:\s*([^;]*?)\s*;` $themecontent }}
|
||||||
{{- $chroma = index . 1 }}
|
{{- $chroma = index . 1 }}
|
||||||
{{- $cssres := resources.Get (printf "css/chroma-%s.css" $chroma) }}
|
{{- $cssres := resources.Get (printf "css/chroma-%s.css" $chroma) }}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
7.2.1+66f4fbf5f04db1aa128d8f951c0883cc226312b9
|
7.2.1+f1701957c30daae7cd133bec5a7968480563ce9f
|
Loading…
Reference in a new issue