From e532637cbc75906281d587e961d58ec4b8ca1837 Mon Sep 17 00:00:00 2001 From: Xin Date: Sat, 28 Dec 2024 15:51:35 +0000 Subject: [PATCH] fix: correct tabs button color on hover in dark mode (#526) * fix: tabs toggle button color in dark mode * chore: update css --- assets/css/compiled/main.css | 8 ++++++++ exampleSite/hugo_stats.json | 2 ++ layouts/shortcodes/tabs.html | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index f4c238dd..ee130305 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -3258,6 +3258,14 @@ body:is(html[class~="dark"] *) { --tw-ring-opacity: 1; --tw-ring-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 32) / var(--tw-ring-opacity)); } +.data-\[state\=selected\]\:dark\:hx-border-primary-500:is(html[class~="dark"] *)[data-state="selected"] { + --tw-border-opacity: 1; + border-color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 50) / var(--tw-border-opacity)); +} +.data-\[state\=selected\]\:dark\:hx-text-primary-600:is(html[class~="dark"] *)[data-state="selected"] { + --tw-text-opacity: 1; + color: hsl(var(--primary-hue) var(--primary-saturation) calc(calc(var(--primary-lightness) / 50) * 45) / var(--tw-text-opacity)); +} @media (prefers-contrast: more) { .contrast-more\:dark\:hx-border-current:is(html[class~="dark"] *) { diff --git a/exampleSite/hugo_stats.json b/exampleSite/hugo_stats.json index ab09e996..65d58c9f 100644 --- a/exampleSite/hugo_stats.json +++ b/exampleSite/hugo_stats.json @@ -197,6 +197,8 @@ "dark:placeholder:hx-text-gray-400", "data-[state=closed]:hx-hidden", "data-[state=open]:hx-hidden", + "data-[state=selected]:dark:hx-border-primary-500", + "data-[state=selected]:dark:hx-text-primary-600", "data-[state=selected]:hx-block", "data-[state=selected]:hx-border-primary-500", "data-[state=selected]:hx-text-primary-600", diff --git a/layouts/shortcodes/tabs.html b/layouts/shortcodes/tabs.html index c1df7cc5..83ad4f37 100644 --- a/layouts/shortcodes/tabs.html +++ b/layouts/shortcodes/tabs.html @@ -9,7 +9,7 @@
{{- range $i, $item := $items -}}