From 3cd048868a27691481e10a7e819005d1c5d27d66 Mon Sep 17 00:00:00 2001 From: MyPrototypeWhat Date: Tue, 2 Dec 2025 18:31:12 +0800 Subject: [PATCH] refactor(theme): comment out spacing variables for Tailwind CSS v4 compatibility - Added comments in theme.css and theme.css files to explain the changes in spacing variable definitions. - Temporarily commented out the `--spacing-5xs` variable due to significant differences with container spacing in Tailwind CSS v4. - Ensured clarity on the priority of CSS variable resolution in Tailwind CSS. --- packages/ui/design-reference/theme.css | 8 ++++++-- packages/ui/src/styles/theme.css | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/ui/design-reference/theme.css b/packages/ui/design-reference/theme.css index 29d83a0cba..48e2cdc838 100644 --- a/packages/ui/design-reference/theme.css +++ b/packages/ui/design-reference/theme.css @@ -321,7 +321,11 @@ /* ==================== */ /* Spacing */ /* ==================== */ - --spacing-5xs: 0.25rem; + /* 在 Tailwind CSS v4 中,像 max-w-md、w-md 这类工具类会按照命名空间优先级查找 CSS 变量: */ + /* --spacing-{value} > --container-{value} */ + /* 下述定义的spacing与container相差巨大,所以先注释掉 */ + + /* --spacing-5xs: 0.25rem; --spacing-4xs: 0.5rem; --spacing-3xs: 0.75rem; --spacing-2xs: 1rem; @@ -336,7 +340,7 @@ --spacing-5xl: 5.5rem; --spacing-6xl: 6rem; --spacing-7xl: 6.5rem; - --spacing-8xl: 7rem; + --spacing-8xl: 7rem; */ /* ==================== */ /* Radius */ diff --git a/packages/ui/src/styles/theme.css b/packages/ui/src/styles/theme.css index 6308a054b4..80cef87f22 100644 --- a/packages/ui/src/styles/theme.css +++ b/packages/ui/src/styles/theme.css @@ -318,7 +318,11 @@ /* ==================== */ /* Spacing */ /* ==================== */ - --spacing-5xs: 0.25rem; + /* 在 Tailwind CSS v4 中,像 max-w-md、w-md 这类工具类会按照命名空间优先级查找 CSS 变量: */ + /* --spacing-{value} > --container-{value} */ + /* 下述定义的spacing与container相差巨大,所以先注释掉 */ + + /* --spacing-5xs: 0.25rem; --spacing-4xs: 0.5rem; --spacing-3xs: 0.75rem; --spacing-2xs: 1rem; @@ -333,7 +337,7 @@ --spacing-5xl: 5.5rem; --spacing-6xl: 6rem; --spacing-7xl: 6.5rem; - --spacing-8xl: 7rem; + --spacing-8xl: 7rem; */ /* ==================== */ /* Radius */