From 26b8c6ef2735245515d9c3c727693309a2ff2cff Mon Sep 17 00:00:00 2001 From: vben Date: Sun, 23 Jun 2024 14:21:27 +0800 Subject: [PATCH] chore: update css --- apps/web-antd/package.json | 2 +- .../src/views/_essential/vben/about/index.vue | 13 +- .../lint-configs/eslint-config/package.json | 2 +- internal/tailwind-config/package.json | 2 +- internal/tailwind-config/src/index.ts | 67 ++-- package.json | 2 +- .../forward/preferences/src/constants.ts | 5 +- .../forward/preferences/src/preferences.ts | 3 +- .../shared/design-tokens/src/dark/index.css | 98 +++-- .../design-tokens/src/default/index.css | 116 +++--- packages/@core/shared/design/src/index.css | 327 ----------------- .../src/components/layout-footer.vue | 2 +- .../src/components/layout-header.vue | 2 +- .../src/components/layout-tabbar.vue | 2 +- .../widgets/sidebar-collapse-button.vue | 2 +- .../widgets/sidebar-fixed-button.vue | 2 +- .../@core/uikit/layout-ui/src/vben-layout.vue | 16 +- .../components/normal-menu/normal-menu.vue | 16 +- .../@core/uikit/menu-ui/src/styles/index.scss | 48 +-- packages/@core/uikit/shadcn-ui/package.json | 2 +- .../shadcn-ui/src/components/logo/logo.vue | 2 +- .../src/components/segmented/segmented.vue | 4 +- .../src/components/ui/sonner/Sonner.vue | 2 +- .../components/chrome-tabs/chrome-tabs.scss | 16 +- packages/business/chart-ui/package.json | 2 +- packages/business/universal-ui/package.json | 2 +- .../src/fallback/icons/icon-403.vue | 2 +- .../src/fallback/icons/icon-404.vue | 77 ++-- .../src/fallback/icons/icon-500.vue | 4 +- .../src/fallback/icons/icon-hello.vue | 10 +- .../src/fallback/icons/icon-offline.vue | 4 +- .../src/global-search/global-search.vue | 2 +- .../src/preferences/blocks/layout/footer.vue | 4 +- .../src/preferences/blocks/layout/header.vue | 8 +- .../src/preferences/blocks/theme/color.vue | 4 +- .../src/preferences/icons/content-compact.vue | 2 +- .../src/preferences/icons/header-nav.vue | 2 +- .../src/preferences/icons/mixed-nav.vue | 2 +- .../preferences/icons/sidebar-mixed-nav.vue | 2 +- .../src/preferences/icons/sidebar-nav.vue | 2 +- .../src/preferences/preferences.vue | 14 +- .../universal-ui/src/preferences/trigger.vue | 2 +- .../src/theme-toggle/theme-button.vue | 12 +- .../src/user-dropdown/user-dropdown.vue | 2 +- packages/locales/src/langs/en-US.yaml | 26 +- packages/locales/src/langs/zh-CN.yaml | 26 +- packages/styles/src/common/nprogress.css | 8 +- pnpm-lock.yaml | 345 +++++------------- vben-admin.code-workspace | 4 + 49 files changed, 401 insertions(+), 920 deletions(-) delete mode 100644 packages/@core/shared/design/src/index.css diff --git a/apps/web-antd/package.json b/apps/web-antd/package.json index 5ebdcc9b9..5b29eb710 100644 --- a/apps/web-antd/package.json +++ b/apps/web-antd/package.json @@ -29,6 +29,7 @@ "@vben-core/preferences": "workspace:*", "@vben-core/request": "workspace:*", "@vben-core/stores": "workspace:*", + "@vben/chart-ui": "workspace:*", "@vben/constants": "workspace:*", "@vben/hooks": "workspace:*", "@vben/icons": "workspace:*", @@ -37,7 +38,6 @@ "@vben/styles": "workspace:*", "@vben/types": "workspace:*", "@vben/universal-ui": "workspace:*", - "@vben/chart-ui": "workspace:*", "@vben/utils": "workspace:*", "@vueuse/core": "^10.11.0", "ant-design-vue": "^4.2.3", diff --git a/apps/web-antd/src/views/_essential/vben/about/index.vue b/apps/web-antd/src/views/_essential/vben/about/index.vue index 6ae422f38..cf24d69a1 100644 --- a/apps/web-antd/src/views/_essential/vben/about/index.vue +++ b/apps/web-antd/src/views/_essential/vben/about/index.vue @@ -1,16 +1,9 @@ diff --git a/internal/lint-configs/eslint-config/package.json b/internal/lint-configs/eslint-config/package.json index 254c7d83b..e1e069433 100644 --- a/internal/lint-configs/eslint-config/package.json +++ b/internal/lint-configs/eslint-config/package.json @@ -38,7 +38,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-i": "^2.29.1", - "eslint-plugin-jsdoc": "^48.2.15", + "eslint-plugin-jsdoc": "^48.4.0", "eslint-plugin-jsonc": "^2.16.0", "eslint-plugin-n": "^17.9.0", "eslint-plugin-no-only-tests": "^3.1.0", diff --git a/internal/tailwind-config/package.json b/internal/tailwind-config/package.json index a7792245b..a44d4f9b5 100644 --- a/internal/tailwind-config/package.json +++ b/internal/tailwind-config/package.json @@ -45,7 +45,7 @@ "tailwindcss": "^3.4.3" }, "dependencies": { - "@iconify/json": "^2.2.221", + "@iconify/json": "^2.2.222", "@iconify/tailwind": "^1.1.1", "@tailwindcss/forms": "^0.5.7", "@tailwindcss/nesting": "0.0.0-insiders.565cd3e", diff --git a/internal/tailwind-config/src/index.ts b/internal/tailwind-config/src/index.ts index 00a7259bd..9e58310e4 100644 --- a/internal/tailwind-config/src/index.ts +++ b/internal/tailwind-config/src/index.ts @@ -62,55 +62,62 @@ export default { '3000': '3000ms', }, borderRadius: { - lg: 'var(--radius-base)', - md: 'calc(var(--radius-base) - 2px)', - sm: 'calc(var(--radius-base) - 4px)', - xl: 'calc(var(--radius-base) + 4px)', + lg: 'var(--radius)', + md: 'calc(var(--radius) - 2px)', + sm: 'calc(var(--radius) - 4px)', + xl: 'calc(var(--radius) + 4px)', }, colors: { accent: { - DEFAULT: 'hsl(var(--color-accent))', - foreground: 'hsl(var(--color-accent-foreground))', - hover: 'hsl(var(--color-accent-hover))', + DEFAULT: 'hsl(var(--accent))', + foreground: 'hsl(var(--accent-foreground))', + hover: 'hsl(var(--accent-hover))', }, - background: 'hsl(var(--color-background) / )', - // body: 'hsl(var(--color-body) / )', - border: 'hsl(var(--color-border))', + background: 'hsl(var(--background))', + border: 'hsl(var(--border))', card: { - DEFAULT: 'hsl(var(--color-card))', - foreground: 'hsl(var(--color-card-foreground))', + DEFAULT: 'hsl(var(--card))', + foreground: 'hsl(var(--card-foreground))', }, destructive: { - DEFAULT: 'hsl(var(--color-destructive))', - foreground: 'hsl(var(--color-destructive-foreground))', + DEFAULT: 'hsl(var(--destructive))', + foreground: 'hsl(var(--destructive-foreground))', }, - foreground: 'hsl(var(--color-foreground) / )', + foreground: 'hsl(var(--foreground) / )', heavy: { - DEFAULT: 'hsl(var(--color-heavy) / )', - foreground: 'hsl(var(--color-heavy-foreground) / )', + DEFAULT: 'hsl(var(--heavy))', + foreground: 'hsl(var(--heavy-foreground))', }, input: { - DEFAULT: 'hsl(var(--color-input))', - background: 'hsl(var(--color-input-background))', + DEFAULT: 'hsl(var(--input))', + background: 'hsl(var(--input-background))', }, muted: { - DEFAULT: 'hsl(var(--color-muted))', - foreground: 'hsl(var(--color-muted-foreground))', + DEFAULT: 'hsl(var(--muted))', + foreground: 'hsl(var(--muted-foreground))', }, - overlay: 'hsl(var(--color-overlay))', + overlay: 'hsl(var(--overlay))', popover: { - DEFAULT: 'hsl(var(--color-popover))', - foreground: 'hsl(var(--color-popover-foreground))', + DEFAULT: 'hsl(var(--popover))', + foreground: 'hsl(var(--popover-foreground))', }, primary: { - DEFAULT: 'hsl(var(--color-primary) / )', - foreground: 'hsl(var(--color-primary-foreground) / )', + DEFAULT: 'hsl(var(--primary) / )', + foreground: 'hsl(var(--primary-foreground) / )', }, - ring: 'hsl(var(--color-ring))', + ring: 'hsl(var(--ring))', secondary: { - DEFAULT: 'hsl(var(--color-secondary) / )', - desc: 'hsl(var(--color-secondary-desc) / )', - foreground: 'hsl(var(--color-secondary-foreground) / )', + DEFAULT: 'hsl(var(--secondary) / )', + desc: 'hsl(var(--secondary-desc) / )', + foreground: 'hsl(var(--secondary-foreground) / )', + }, + success: { + DEFAULT: 'hsl(var(--success))', + foreground: 'hsl(var(--success-foreground))', + }, + warning: { + DEFAULT: 'hsl(var(--warning))', + foreground: 'hsl(var(--warning-foreground))', }, }, fontFamily: { diff --git a/package.json b/package.json index 56603542b..7bd4cd9df 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ }, "devDependencies": { "@changesets/changelog-github": "^0.5.0", - "@changesets/cli": "^2.27.5", + "@changesets/cli": "^2.27.6", "@ls-lint/ls-lint": "^2.2.3", "@types/jsdom": "^21.1.7", "@types/node": "^20.14.8", diff --git a/packages/@core/forward/preferences/src/constants.ts b/packages/@core/forward/preferences/src/constants.ts index 116cb2d2c..110219880 100644 --- a/packages/@core/forward/preferences/src/constants.ts +++ b/packages/@core/forward/preferences/src/constants.ts @@ -9,9 +9,10 @@ export const COLOR_PRIMARY_RESETS = [ 'hsl(211 91% 39%)', 'hsl(212 100% 45%)', 'hsl(181 84% 32%)', - 'hsl(230 99% 66%)', + 'hsl(161 90% 43%)', + 'hsl(231 98% 65%)', 'hsl(245 82% 67%)', - 'hsl(340 100% 68%)', + 'hsl(347 77% 60%)', ]; export const SUPPORT_LANGUAGES: Language[] = [ diff --git a/packages/@core/forward/preferences/src/preferences.ts b/packages/@core/forward/preferences/src/preferences.ts index 2085b4953..0e63aa704 100644 --- a/packages/@core/forward/preferences/src/preferences.ts +++ b/packages/@core/forward/preferences/src/preferences.ts @@ -182,8 +182,7 @@ class PreferenceManager { if (preference.theme) { for (const [key, value] of Object.entries(preference.theme)) { if (['colorPrimary'].includes(key)) { - const cssVarKey = key.replaceAll(/([A-Z])/g, '-$1').toLowerCase(); - const cssVarValue = useCssVar(`--${cssVarKey}`); + const cssVarValue = useCssVar(`--primary`); cssVarValue.value = convertToHslCssVar(value); } } diff --git a/packages/@core/shared/design-tokens/src/dark/index.css b/packages/@core/shared/design-tokens/src/dark/index.css index 9cb97cef9..679b4755f 100644 --- a/packages/@core/shared/design-tokens/src/dark/index.css +++ b/packages/@core/shared/design-tokens/src/dark/index.css @@ -1,76 +1,68 @@ :root.dark { - /* 基础背景颜色颜色 */ + /* Default background color of ...etc */ + --background: 220deg 13.04% 8%; + --foreground: 220 13% 91%; - --color-background: 220deg 13.04% 8%; + /* Background color for */ + --card: 222.2 84% 4.9%; + --card-foreground: 210 40% 98%; - /* 基础文本颜色 */ - --color-foreground: 220 13% 91%; + /* Background color for popovers such as , , */ + --popover: 222.86deg 8.43% 16.27%; + --popover-foreground: 210 40% 98%; + + /* Muted backgrounds such as , and */ + --muted: 220deg 6.82% 17.25%; + --muted-foreground: 215 20.2% 65.1%; /* 主题颜色 */ - --color-primary: 211 91% 39%; + --primary: 211 91% 39%; + --primary-foreground: 0 0 98%; - /* 前景色,如按钮文本颜色 */ - --color-primary-foreground: 0 0 98%; + /* Used for destructive actions such as