From 89b2d123fc2315554ce96551daf2202b4f526e67 Mon Sep 17 00:00:00 2001 From: tommy Date: Fri, 7 Nov 2025 14:44:41 +0800 Subject: [PATCH] fix style --- assets/styling/shadcn.css | 20 ++++++++++++++++++++ src/components/ui/select.rs | 16 ++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/assets/styling/shadcn.css b/assets/styling/shadcn.css index 36f4a3f..b202a6a 100644 --- a/assets/styling/shadcn.css +++ b/assets/styling/shadcn.css @@ -1134,6 +1134,26 @@ cursor: pointer; } +.ui-select-icon { + display: inline-flex; + align-items: center; + justify-content: center; + width: 1rem; + height: 1rem; + color: hsl(var(--muted-foreground)); + transition: transform 0.2s ease, color 0.2s ease; +} + +.ui-select-icon svg { + width: 100%; + height: 100%; +} + +.ui-select-trigger[data-open="true"] .ui-select-icon { + transform: rotate(180deg); + color: hsl(var(--foreground)); +} + .ui-select-trigger:focus-visible, .ui-dropdown-trigger:focus-visible { outline: none; diff --git a/src/components/ui/select.rs b/src/components/ui/select.rs index 8d03716..05182c4 100644 --- a/src/components/ui/select.rs +++ b/src/components/ui/select.rs @@ -65,8 +65,20 @@ pub fn Select( }, span { "{display_text}" } span { - style: "font-size: 0.8rem; opacity: 0.7;", - if open() { "▲" } else { "▼" } + class: "ui-select-icon", + "aria-hidden": "true", + svg { + view_box: "0 0 16 16", + xmlns: "http://www.w3.org/2000/svg", + path { + d: "M4 6l4 4 4-4", + fill: "none", + stroke: "currentColor", + "stroke-width": "1.5", + "stroke-linecap": "round", + "stroke-linejoin": "round", + } + } } } if open() {