tree: use correct color for found styles #1067

This commit is contained in:
Sören Weber 2025-03-24 15:31:50 +01:00
parent c5d591c514
commit 64c314c654
No known key found for this signature in database
GPG Key ID: BEC6D55545451B6D
3 changed files with 26 additions and 4 deletions

View File

@ -18,7 +18,29 @@
) }}
{{- if eq .identifier $style }}
{{- $title := .identifier | T }}
{{- $set = dict "identifier" .identifier "style" $style "title" $title "icon" .icon }}
{{- $set = dict "style" $style "title" $title "icon" .icon }}
{{- break }}
{{- end }}
{{- end }}
{{- end }}
{{- if not $set }}
{{- range (slice
(dict "identifier" "primary")
(dict "identifier" "secondary")
(dict "identifier" "accent")
(dict "identifier" "blue")
(dict "identifier" "cyan")
(dict "identifier" "green")
(dict "identifier" "grey")
(dict "identifier" "magenta")
(dict "identifier" "orange")
(dict "identifier" "red")
(dict "identifier" "default")
(dict "identifier" "transparent")
(dict "identifier" "code")
) }}
{{- if eq .identifier $style }}
{{- $set = dict "style" $style "title" "" "icon" "" }}
{{- break }}
{{- end }}
{{- end }}

View File

@ -13,14 +13,14 @@
{{- $classes := split $icon " " }}
{{- if eq (len $classes) 1 }}
{{- $boxStyle := partial "_relearn/boxStyle.gotmpl" (dict "style" $color) }}
{{- if $boxStyle.identifier }}
{{- if $boxStyle.style }}
{{- $replacement = printf `<li><i class="fa-fw fas fa-%s cstyle %s"></i><span>%s</span>%s` $icon $color $name $rest }}
{{- else }}
{{- $replacement = printf `<li><i class="fa-fw fas fa-%s" style="color: %s;"></i><span>%s</span>%s` $icon $color $name $rest }}
{{- end }}
{{- else }}
{{- $boxStyle := partial "_relearn/boxStyle.gotmpl" (dict "style" $color) }}
{{- if $boxStyle.identifier }}
{{- if $boxStyle.style }}
{{- $replacement = printf `<li><i class="%s cstyle %s"></i><span>%s</span>%s` $icon $color $name $rest }}
{{- else }}
{{- $replacement = printf `<li><i class="%s" style="color: %s;"></i><span>%s</span>%s` $icon $color $name $rest }}

View File

@ -1 +1 @@
7.5.0+c062fd1ed2a28faac56d4693a8f6e236345f9706
7.5.0+c5d591c5149619f251e2a6de0392c513b10b31d1