瀏覽代碼

fix: when borderRaidus is a string, the component displays an exception (#4102)

Vben 7 月之前
父節點
當前提交
344c499462
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      packages/effects/hooks/src/use-design-tokens.ts

+ 3 - 1
packages/effects/hooks/src/use-design-tokens.ts

@@ -56,7 +56,9 @@ export function useAntdDesignTokens() {
 
       tokens.colorBgBase = getCssVariableValue('--background');
 
-      tokens.borderRadius = getCssVariableValue('--radius', false);
+      const radius = Number.parseFloat(getCssVariableValue('--radius', false));
+      // 1rem = 16px
+      tokens.borderRadius = radius * 16;
 
       tokens.colorBgLayout = getCssVariableValue('--background-deep');
       tokens.colorBgMask = getCssVariableValue('--overlay');