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.

fix(ui): fix dark mode styles for font family components (#6381)

白熱4e9e3811e0d9
diff --git a/packages/sheets-formula-ui/src/controllers/menu.ts b/packages/sheets-formula-ui/src/controllers/menu.ts
index b6ead24be1..e9eca3d247 100644
--- a/packages/sheets-formula-ui/src/controllers/menu.ts
+++ b/packages/sheets-formula-ui/src/controllers/menu.ts
@@ -17,7 +17,15 @@
import type { IAccessor, Workbook } from '@univerjs/core';
import type { IMenuItem } from '@univerjs/ui';
import { IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
-import { RangeProtectionPermissionEditPoint, RangeProtectionPermissionViewPoint, WorkbookCopyPermission, WorkbookEditablePermission, WorksheetCopyPermission, WorksheetEditPermission, WorksheetSetCellValuePermission } from '@univerjs/sheets';
+import {
+ RangeProtectionPermissionEditPoint,
+ RangeProtectionPermissionViewPoint,
+ WorkbookCopyPermission,
+ WorkbookEditablePermission,
+ WorksheetCopyPermission,
+ WorksheetEditPermission,
+ WorksheetSetCellValuePermission,
+} from '@univerjs/sheets';
import { getCurrentRangeDisable$ } from '@univerjs/sheets-ui';
import { getMenuHiddenObservable, IClipboardInterfaceService, MenuItemType } from '@univerjs/ui';
import { combineLatestWith, map, Observable, of, switchMap } from 'rxjs';
diff --git a/packages/sheets-numfmt-ui/src/views/components/MoreNumfmtType.tsx b/packages/sheets-numfmt-ui/src/views/components/MoreNumfmtType.tsx
index a6bbf033da..b8dafadae1 100644
--- a/packages/sheets-numfmt-ui/src/views/components/MoreNumfmtType.tsx
+++ b/packages/sheets-numfmt-ui/src/views/components/MoreNumfmtType.tsx
@@ -18,7 +18,13 @@ import type { FormatType } from '@univerjs/sheets';
import { ICommandService, LocaleService, Range } from '@univerjs/core';
import { Separator } from '@univerjs/design';
import { SheetsSelectionsService } from '@univerjs/sheets';
-import { getPatternPreview, getPatternType, localeCurrencySymbolMap, SetNumfmtCommand, SheetsNumfmtCellContentController } from '@univerjs/sheets-numfmt';
+import {
+ getPatternPreview,
+ getPatternType,
+ localeCurrencySymbolMap,
+ SetNumfmtCommand,
+ SheetsNumfmtCellContentController,
+} from '@univerjs/sheets-numfmt';
import { ILayoutService, useDependency } from '@univerjs/ui';
import { useMemo } from 'react';
import { OpenNumfmtPanelOperator } from '../../commands/operations/open.numfmt.panel.operation';
@@ -102,7 +108,12 @@ export function Options() {
>
<span>{localeService.t(item.label)}</span>
- <span className="univer-text-xs univer-text-gray-500">
+ <span
+ className={`
+ univer-text-xs univer-text-gray-500
+ dark:!univer-text-gray-400
+ `}
+ >
{item.pattern ? getPatternPreview(item.pattern || '', defaultValue, sheetsNumfmtCellContentController.locale).result.trim() : ''}
</span>
</div>
diff --git a/packages/ui/src/components/font-family/FontFamily.tsx b/packages/ui/src/components/font-family/FontFamily.tsx
index f2a868d062..31f376aca1 100644
--- a/packages/ui/src/components/font-family/FontFamily.tsx
+++ b/packages/ui/src/components/font-family/FontFamily.tsx
@@ -113,6 +113,7 @@ export const FontFamily = ({ id, value, disabled$ }: IFontFamilyProps) => {
className={`
univer-block univer-h-6 univer-border-none univer-bg-transparent univer-leading-6
focus:univer-outline-none
+ dark:!univer-text-white
[&_input:focus]:!univer-ring-0
[&_input]:univer-h-6 [&_input]:univer-w-7 [&_input]:univer-border-none
[&_input]:!univer-bg-transparent [&_input]:univer-p-0 [&_input]:univer-text-sm
diff --git a/packages/ui/src/components/font-family/FontFamilyItem.tsx b/packages/ui/src/components/font-family/FontFamilyItem.tsx
index 8d0e5fc315..f2aa1112ce 100644
--- a/packages/ui/src/components/font-family/FontFamilyItem.tsx
+++ b/packages/ui/src/components/font-family/FontFamilyItem.tsx
@@ -57,7 +57,7 @@ export const FontFamilyItem = ({ id, value }: { id: string; value: string }) =>
univer-justify-between univer-gap-6 univer-rounded univer-border-none univer-bg-transparent
univer-px-2
hover:univer-bg-gray-100
- dark:hover:!univer-bg-gray-700
+ dark:!univer-text-white dark:hover:!univer-bg-gray-700
`}
style={{
fontFamily: font.value,
@@ -72,7 +72,7 @@ export const FontFamilyItem = ({ id, value }: { id: string; value: string }) =>
<InfoIcon
className={`
univer-text-gray-300
- dark:univer-text-gray-700
+ dark:!univer-text-gray-400
`}
/>
</Tooltip>