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(themes): add yellow theme (#7351)

白熱24aa8ff89e9d
diff --git a/common/debugger/src/views/use-theme.ts b/common/debugger/src/views/use-theme.ts
index 587f2aafcd..fbac85dfe5 100644
--- a/common/debugger/src/views/use-theme.ts
+++ b/common/debugger/src/views/use-theme.ts
@@ -1,5 +1,5 @@
import { ThemeService } from '@univerjs/core';
-import { defaultTheme, greenTheme, orangeTheme, purpleTheme, redTheme } from '@univerjs/themes';
+import { defaultTheme, greenTheme, orangeTheme, purpleTheme, redTheme, yellowTheme } from '@univerjs/themes';
import { useDependency } from '@univerjs/ui';
import { useEffect } from 'react';
@@ -24,6 +24,10 @@ const themes = [
label: '🟣',
value: purpleTheme,
},
+ {
+ label: '🟡',
+ value: yellowTheme,
+ },
];
export function useTheme() {
diff --git a/examples/src/theme-customizer/constants.ts b/examples/src/theme-customizer/constants.ts
index 52fa997d89..a9f0385a67 100644
--- a/examples/src/theme-customizer/constants.ts
+++ b/examples/src/theme-customizer/constants.ts
@@ -1,5 +1,6 @@
import type { IThemePreset, ThemeScaleKey, ThemeShadeKey, TokenDensity } from './types';
-import { defaultTheme, greenTheme, orangeTheme, purpleTheme, redTheme } from '@univerjs/themes';
+
+import { defaultTheme, greenTheme, orangeTheme, purpleTheme, redTheme, yellowTheme } from '@univerjs/themes';
export const PREVIEW_CONTAINER_ID = 'theme-customizer-preview';
@@ -21,6 +22,7 @@ export const THEME_PRESETS: IThemePreset[] = [
{ key: 'orange', label: 'orangeTheme', theme: orangeTheme },
{ key: 'red', label: 'redTheme', theme: redTheme },
{ key: 'purple', label: 'purpleTheme', theme: purpleTheme },
+ { key: 'yellow', label: 'yellowTheme', theme: yellowTheme },
];
export const TOKEN_DENSITY_LABELS: Record<TokenDensity, string> = {
diff --git a/examples/src/theme-customizer/types.ts b/examples/src/theme-customizer/types.ts
index 32617a0a98..dd4e9f1b47 100644
--- a/examples/src/theme-customizer/types.ts
+++ b/examples/src/theme-customizer/types.ts
@@ -7,7 +7,7 @@ export type EditorMode = 'tokens' | 'json';
export type TokenDensity = 'core' | 'full';
export interface IThemePreset {
- key: 'default' | 'green' | 'red' | 'purple' | 'orange';
+ key: 'default' | 'green' | 'red' | 'purple' | 'orange' | 'yellow';
label: string;
theme: Theme;
}
diff --git a/packages/themes/README.md b/packages/themes/README.md
index 9077bbc380..f459c1fc26 100644
--- a/packages/themes/README.md
+++ b/packages/themes/README.md
@@ -4,7 +4,7 @@
[![license](https://img.shields.io/npm/l/@univerjs/themes?style=flat-square)](https://npmjs.com/package/@univerjs/themes)
[![downloads](https://img.shields.io/npm/dm/@univerjs/themes?style=flat-square)](https://npmjs.com/package/@univerjs/themes)
-`@univerjs/themes` contains built-in Univer theme definitions such as the default, green, orange, red, and purple themes.
+`@univerjs/themes` contains built-in Univer theme definitions such as the default, green, orange, purple, red, and yellow themes.
## Package Overview
@@ -25,7 +25,7 @@ Keep all `@univerjs/*` packages on the same version.
## Usage
```ts
-import { defaultTheme, greenTheme, orangeTheme, purpleTheme, redTheme } from '@univerjs/themes';
+import { defaultTheme, greenTheme, orangeTheme, purpleTheme, redTheme, yellowTheme } from '@univerjs/themes';
```
## Resources
diff --git a/packages/themes/src/index.ts b/packages/themes/src/index.ts
index 429df26c23..97352f80c7 100644
--- a/packages/themes/src/index.ts
+++ b/packages/themes/src/index.ts
@@ -20,3 +20,4 @@ export { default as greenTheme } from './green';
export { default as orangeTheme } from './orange';
export { default as purpleTheme } from './purple';
export { default as redTheme } from './red';
+export { default as yellowTheme } from './yellow';
diff --git a/packages/themes/src/yellow.ts b/packages/themes/src/yellow.ts
new file mode 100644
index 0000000000..bfd4046320
--- /dev/null
+++ b/packages/themes/src/yellow.ts
@@ -0,0 +1,190 @@
+/**
+ * Copyright 2023-present DreamNum Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import type { Theme } from './default';
+
+const yellowTheme: Theme = {
+ white: '#FFFFFF',
+ black: '#000000',
+ primary: {
+ 50: '#FEFCE8',
+ 100: '#FEF9C3',
+ 200: '#FEF08A',
+ 300: '#FDE047',
+ 400: '#FACC15',
+ 500: '#EAB308',
+ 600: '#A16207',
+ 700: '#854D0E',
+ 800: '#713F12',
+ 900: '#422006',
+ },
+ gray: {
+ 50: '#FAFAF9',
+ 100: '#F5F5F4',
+ 200: '#E7E5E4',
+ 300: '#D6D3D1',
+ 400: '#A8A29E',
+ 500: '#78716C',
+ 600: '#57534E',
+ 700: '#44403C',
+ 800: '#292524',
+ 900: '#1C1917',
+ },
+ blue: {
+ 50: '#EFF6FF',
+ 100: '#DBEAFE',
+ 200: '#BFDBFE',
+ 300: '#93C5FD',
+ 400: '#60A5FA',
+ 500: '#3B82F6',
+ 600: '#2563EB',
+ 700: '#1D4ED8',
+ 800: '#1E40AF',
+ 900: '#1E3A8A',
+ },
+ red: {
+ 50: '#FFF1F2',
+ 100: '#FFE4E6',
+ 200: '#FECDD3',
+ 300: '#FDA4AF',
+ 400: '#FB7185',
+ 500: '#F43F5E',
+ 600: '#E11D48',
+ 700: '#BE123C',
+ 800: '#9F1239',
+ 900: '#881337',
+ },
+ orange: {
+ 50: '#FFF7ED',
+ 100: '#FFEDD5',
+ 200: '#FED7AA',
+ 300: '#FDBA74',
+ 400: '#FB923C',
+ 500: '#F97316',
+ 600: '#EA580C',
+ 700: '#C2410C',
+ 800: '#9A3412',
+ 900: '#7C2D12',
+ },
+ yellow: {
+ 50: '#FEFCE8',
+ 100: '#FEF9C3',
+ 200: '#FEF08A',
+ 300: '#FDE047',
+ 400: '#FACC15',
+ 500: '#EAB308',
+ 600: '#CA8A04',
+ 700: '#A16207',
+ 800: '#854D0E',
+ 900: '#713F12',
+ },
+ green: {
+ 50: '#F0FDF4',
+ 100: '#DCFCE7',
+ 200: '#BBF7D0',
+ 300: '#86EFAC',
+ 400: '#4ADE80',
+ 500: '#22C55E',
+ 600: '#16A34A',
+ 700: '#15803D',
+ 800: '#166534',
+ 900: '#14532D',
+ },
+ jiqing: {
+ 50: '#ECFEFF',
+ 100: '#CFFAFE',
+ 200: '#A5F3FC',
+ 300: '#67E8F9',
+ 400: '#22D3EE',
+ 500: '#06B6D4',
+ 600: '#0891B2',
+ 700: '#0E7490',
+ 800: '#155E75',
+ 900: '#164E63',
+ },
+ indigo: {
+ 50: '#EEF2FF',
+ 100: '#E0E7FF',
+ 200: '#C7D2FE',
+ 300: '#A5B4FC',
+ 400: '#818CF8',
+ 500: '#6366F1',
+ 600: '#4F46E5',
+ 700: '#4338CA',
+ 800: '#3730A3',
+ 900: '#312E81',
+ },
+ purple: {
+ 50: '#FAF5FF',
+ 100: '#F3E8FF',
+ 200: '#E9D5FF',
+ 300: '#D8B4FE',
+ 400: '#C084FC',
+ 500: '#A855F7',
+ 600: '#9333EA',
+ 700: '#7E22CE',
+ 800: '#6B21A8',
+ 900: '#581C87',
+ },
+ pink: {
+ 50: '#FDF2F8',
+ 100: '#FCE7F3',
+ 200: '#FBCFE8',
+ 300: '#F9A8D4',
+ 400: '#F472B6',
+ 500: '#EC4899',
+ 600: '#DB2777',
+ 700: '#BE185D',
+ 800: '#9D174D',
+ 900: '#831843',
+ },
+ 'loop-color': {
+ 1: 'primary.500',
+ 2: 'green.500',
+ 3: 'blue.500',
+ 4: 'purple.500',
+ 5: 'red.500',
+ 6: 'jiqing.500',
+ 7: 'pink.500',
+ 8: 'orange.500',
+ 9: 'indigo.600',
+ 10: 'yellow.700',
+ 11: 'gray.700',
+ 12: 'green.700',
+ },
+ highlight: {
+ background: {
+ 1: { color: 'primary.500', alpha: 0.28 },
+ 2: { color: 'green.500', alpha: 0.28 },
+ 3: { color: 'blue.500', alpha: 0.28 },
+ 4: { color: 'purple.500', alpha: 0.28 },
+ 5: { color: 'red.500', alpha: 0.28 },
+ 6: { color: 'jiqing.500', alpha: 0.28 },
+ 7: { color: 'pink.500', alpha: 0.28 },
+ 8: { color: 'gray.400', alpha: 0.28 },
+ 9: { color: 'primary.500', alpha: 0.14 },
+ 10: { color: 'green.500', alpha: 0.14 },
+ 11: { color: 'blue.500', alpha: 0.14 },
+ 12: { color: 'purple.500', alpha: 0.14 },
+ 13: { color: 'red.500', alpha: 0.14 },
+ 14: { color: 'jiqing.500', alpha: 0.14 },
+ 15: { color: 'pink.500', alpha: 0.14 },
+ 16: { color: 'gray.400', alpha: 0.14 },
+ },
+ },
+};
+
+export default yellowTheme;