feat: theme switcher
This commit is contained in:
@@ -1,14 +1,31 @@
|
||||
<style>
|
||||
:root {
|
||||
.default {
|
||||
{{ if .BackgroundColor }}
|
||||
--bgh: {{ .BackgroundColor.Hue }};
|
||||
--bgs: {{ .BackgroundColor.Saturation }}%;
|
||||
--bgl: {{ .BackgroundColor.Lightness }}%;
|
||||
{{ end }}
|
||||
|
||||
{{ if ne 0.0 .ContrastMultiplier }}--cm: {{ .ContrastMultiplier }};{{ end }}
|
||||
{{ if ne 0.0 .TextSaturationMultiplier }}--tsm: {{ .TextSaturationMultiplier }};{{ end }}
|
||||
{{ if .PrimaryColor }}--color-primary: {{ .PrimaryColor.String | safeCSS }};{{ end }}
|
||||
{{ if .PositiveColor }}--color-positive: {{ .PositiveColor.String | safeCSS }};{{ end }}
|
||||
{{ if .NegativeColor }}--color-negative: {{ .NegativeColor.String | safeCSS }};{{ end }}
|
||||
}
|
||||
</style>
|
||||
|
||||
{{ range $name,$theme := .Presets }}
|
||||
.{{ $name }} {
|
||||
{{ if .BackgroundColor }}
|
||||
--bgh: {{ $theme.BackgroundColor.Hue }};
|
||||
--bgs: {{ $theme.BackgroundColor.Saturation }}%;
|
||||
--bgl: {{ $theme.BackgroundColor.Lightness }}%;
|
||||
{{ end }}
|
||||
|
||||
{{ if ne 0.0 $theme.ContrastMultiplier }}--cm: {{ $theme.ContrastMultiplier }};{{ end }}
|
||||
{{ if ne 0.0 $theme.TextSaturationMultiplier }}--tsm: {{ $theme.TextSaturationMultiplier }};{{ end }}
|
||||
{{ if $theme.PrimaryColor }}--color-primary: {{ $theme.PrimaryColor.String | safeCSS }};{{ end }}
|
||||
{{ if $theme.PositiveColor }}--color-positive: {{ $theme.PositiveColor.String | safeCSS }};{{ end }}
|
||||
{{ if $theme.NegativeColor }}--color-negative: {{ $theme.NegativeColor.String | safeCSS }};{{ end }}
|
||||
}
|
||||
{{ end }}
|
||||
</style>
|
||||
Reference in New Issue
Block a user