forked from drowl87/hextra_mirror
refactor: move sidebar item styles to css
This commit is contained in:
parent
a1c7acd6b5
commit
8c789626be
@ -18,4 +18,16 @@
|
|||||||
li.open > a > span > svg > path {
|
li.open > a > span > svg > path {
|
||||||
@apply hx-rotate-90;
|
@apply hx-rotate-90;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sidebar-item {
|
||||||
|
@apply hx-flex hx-items-center hx-justify-between hx-gap-2 hx-cursor-pointer hx-rounded hx-px-2 hx-py-1.5 hx-text-sm hx-transition-colors;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-item-active {
|
||||||
|
@apply hx-bg-primary-100 hx-font-semibold hx-text-primary-800 contrast-more:hx-border contrast-more:hx-border-primary-500 dark:hx-bg-primary-400/10 dark:hx-text-primary-600 contrast-more:dark:hx-border-primary-500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-item-inactive {
|
||||||
|
@apply hx-text-gray-500 hover:hx-bg-gray-100 hover:hx-text-gray-900 contrast-more:hx-border contrast-more:hx-border-transparent contrast-more:hx-text-gray-900 contrast-more:hover:hx-border-gray-900 dark:hx-text-neutral-400 dark:hover:hx-bg-primary-100/5 dark:hover:hx-text-gray-50 contrast-more:dark:hx-text-gray-50 contrast-more:dark:hover:hx-border-gray-50;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
{{- $external := strings.HasPrefix .link "http" -}}
|
{{- $external := strings.HasPrefix .link "http" -}}
|
||||||
|
|
||||||
|
{{- $activeClass := cond (.active) "sidebar-item-active" "sidebar-item-inactive" -}}
|
||||||
|
|
||||||
|
|
||||||
<a
|
<a
|
||||||
class="hx-flex hx-items-center hx-justify-between hx-gap-2 hx-cursor-pointer hx-rounded hx-px-2 hx-py-1.5 hx-text-sm hx-transition-colors [-webkit-tap-highlight-color:transparent] [-webkit-touch-callout:none] [word-break:break-word]
|
class="sidebar-item {{ $activeClass }} [-webkit-tap-highlight-color:transparent] [-webkit-touch-callout:none] [word-break:break-word]"
|
||||||
{{- if .active }}
|
|
||||||
sidebar-active-item hx-bg-primary-100 hx-font-semibold hx-text-primary-800 contrast-more:hx-border contrast-more:hx-border-primary-500 dark:hx-bg-primary-400/10 dark:hx-text-primary-600 contrast-more:dark:hx-border-primary-500
|
|
||||||
{{- else }}
|
|
||||||
hx-text-gray-500 hover:hx-bg-gray-100 hover:hx-text-gray-900 contrast-more:hx-border contrast-more:hx-border-transparent contrast-more:hx-text-gray-900 contrast-more:hover:hx-border-gray-900 dark:hx-text-neutral-400 dark:hover:hx-bg-primary-100/5 dark:hover:hx-text-gray-50 contrast-more:dark:hx-text-gray-50 contrast-more:dark:hover:hx-border-gray-50
|
|
||||||
{{- end -}}"
|
|
||||||
href="{{ .link }}"
|
href="{{ .link }}"
|
||||||
{{ if $external }}target="_blank" rel="noreferer"{{ end }}
|
{{ if $external }}target="_blank" rel="noreferer"{{ end }}
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user