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 orange theme (#7097)

白熱b55d9e00d884
diff --git a/common/debugger/src/views/use-theme.ts b/common/debugger/src/views/use-theme.ts
index 7fcc69aa43..f6b96c7bac 100644
--- a/common/debugger/src/views/use-theme.ts
+++ b/common/debugger/src/views/use-theme.ts
@@ -15,7 +15,7 @@
*/
import { ThemeService } from '@univerjs/core';
-import { defaultTheme, greenTheme, purpleTheme, redTheme } from '@univerjs/themes';
+import { defaultTheme, greenTheme, orangeTheme, purpleTheme, redTheme } from '@univerjs/themes';
import { useDependency } from '@univerjs/ui';
import { useEffect } from 'react';
@@ -28,6 +28,10 @@ const themes = [
label: '🔵',
value: defaultTheme,
},
+ {
+ label: '🟠',
+ value: orangeTheme,
+ },
{
label: '🔴',
value: redTheme,
diff --git a/examples/src/theme-customizer/constants.ts b/examples/src/theme-customizer/constants.ts
index 71adcd618b..c3f9dec167 100644
--- a/examples/src/theme-customizer/constants.ts
+++ b/examples/src/theme-customizer/constants.ts
@@ -15,7 +15,7 @@
*/
import type { IThemePreset, ThemeScaleKey, ThemeShadeKey, TokenDensity } from './types';
-import { defaultTheme, greenTheme, purpleTheme, redTheme } from '@univerjs/themes';
+import { defaultTheme, greenTheme, orangeTheme, purpleTheme, redTheme } from '@univerjs/themes';
export const PREVIEW_CONTAINER_ID = 'theme-customizer-preview';
@@ -34,6 +34,7 @@ export const LOOP_COLOR_OPTIONS = COLOR_SCALE_KEYS.flatMap((scale) =>
export const THEME_PRESETS: IThemePreset[] = [
{ key: 'default', label: 'defaultTheme', theme: defaultTheme },
{ key: 'green', label: 'greenTheme', theme: greenTheme },
+ { key: 'orange', label: 'orangeTheme', theme: orangeTheme },
{ key: 'red', label: 'redTheme', theme: redTheme },
{ key: 'purple', label: 'purpleTheme', theme: purpleTheme },
];
diff --git a/examples/src/theme-customizer/types.ts b/examples/src/theme-customizer/types.ts
index 96708a9e60..ac847d8555 100644
--- a/examples/src/theme-customizer/types.ts
+++ b/examples/src/theme-customizer/types.ts
@@ -23,7 +23,7 @@ export type EditorMode = 'tokens' | 'json';
export type TokenDensity = 'core' | 'full';
export interface IThemePreset {
- key: 'default' | 'green' | 'red' | 'purple';
+ key: 'default' | 'green' | 'red' | 'purple' | 'orange';
label: string;
theme: Theme;
}
diff --git a/packages/themes/README.md b/packages/themes/README.md
index 832eabb0f2..9077bbc380 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, red, and purple themes.
+`@univerjs/themes` contains built-in Univer theme definitions such as the default, green, orange, red, and purple themes.
## Package Overview
@@ -25,7 +25,7 @@ Keep all `@univerjs/*` packages on the same version.
## Usage
```ts
-import { defaultTheme, greenTheme, purpleTheme, redTheme } from '@univerjs/themes';
+import { defaultTheme, greenTheme, orangeTheme, purpleTheme, redTheme } from '@univerjs/themes';
```
## Resources
diff --git a/packages/themes/src/index.ts b/packages/themes/src/index.ts
index c749f71737..6a937659be 100644
--- a/packages/themes/src/index.ts
+++ b/packages/themes/src/index.ts
@@ -16,5 +16,6 @@
export { default as defaultTheme, type Theme } from './default';
export { default as greenTheme } from './green';
+export { default as orangeTheme } from './orange';
export { default as purpleTheme } from './purple';
export { default as redTheme } from './red';
diff --git a/packages/themes/src/orange.ts b/packages/themes/src/orange.ts
new file mode 100644
index 0000000000..6fe66f2bac
--- /dev/null
+++ b/packages/themes/src/orange.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 orangeTheme: Theme = {
+ white: '#FFFFFF',
+ black: '#000000',
+ primary: {
+ 50: '#FFF7ED',
+ 100: '#FFEDD5',
+ 200: '#FED7AA',
+ 300: '#FDBA74',
+ 400: '#FB923C',
+ 500: '#F97316',
+ 600: '#EA580C',
+ 700: '#C2410C',
+ 800: '#9A3412',
+ 900: '#7C2D12',
+ },
+ 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: 'yellow.500',
+ 3: 'red.500',
+ 4: 'pink.500',
+ 5: 'purple.500',
+ 6: 'blue.500',
+ 7: 'jiqing.500',
+ 8: 'green.500',
+ 9: 'indigo.600',
+ 10: 'orange.700',
+ 11: 'gray.700',
+ 12: 'yellow.700',
+ },
+ highlight: {
+ background: {
+ 1: { color: 'primary.500', alpha: 0.28 },
+ 2: { color: 'yellow.500', alpha: 0.28 },
+ 3: { color: 'red.500', alpha: 0.28 },
+ 4: { color: 'pink.500', alpha: 0.28 },
+ 5: { color: 'purple.500', alpha: 0.28 },
+ 6: { color: 'blue.500', alpha: 0.28 },
+ 7: { color: 'green.500', alpha: 0.28 },
+ 8: { color: 'gray.400', alpha: 0.28 },
+ 9: { color: 'primary.500', alpha: 0.14 },
+ 10: { color: 'yellow.500', alpha: 0.14 },
+ 11: { color: 'red.500', alpha: 0.14 },
+ 12: { color: 'pink.500', alpha: 0.14 },
+ 13: { color: 'purple.500', alpha: 0.14 },
+ 14: { color: 'blue.500', alpha: 0.14 },
+ 15: { color: 'green.500', alpha: 0.14 },
+ 16: { color: 'gray.400', alpha: 0.14 },
+ },
+ },
+};
+
+export default orangeTheme;