Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

feat(ui): add segmented component dark mode (#5059)

Wenzhao Hu43b28531bf9f
diff --git a/packages/design/src/components/segmented/Segmented.tsx b/packages/design/src/components/segmented/Segmented.tsx
index 46a0fd9a7c..a8334b991e 100644
--- a/packages/design/src/components/segmented/Segmented.tsx
+++ b/packages/design/src/components/segmented/Segmented.tsx
@@ -100,12 +100,14 @@ export function Segmented<T extends ItemValue = ItemValue>({
ref={containerRef}
className={clsx(`
univer-relative univer-box-border univer-flex univer-gap-4 univer-rounded-lg univer-bg-gray-100 univer-p-1
+ dark:univer-bg-gray-800
`, className)}
>
<div
className={`
univer-absolute univer-h-6 univer-rounded-md univer-bg-white univer-shadow-sm univer-transition-all
univer-duration-200 univer-animate-univer-slide
+ dark:univer-bg-gray-700 dark:univer-text-gray-400
`}
style={slideStyle}
/>
@@ -121,8 +123,8 @@ export function Segmented<T extends ItemValue = ItemValue>({
univer-bg-transparent univer-px-3 univer-py-1 univer-text-xs univer-font-medium
univer-transition-colors
`, {
- 'univer-text-gray-900': selectedItem === item.value,
- 'univer-text-gray-500 hover:univer-text-gray-900': selectedItem !== item.value,
+ 'univer-text-gray-900 dark:univer-text-white': selectedItem === item.value,
+ 'univer-text-gray-500 dark:hover:univer-text-white hover:univer-text-gray-900': selectedItem !== item.value,
})}
type="button"
onClick={() => handleClick(item.value)}