Pārlūkot izejas kodu

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

Vben 7 mēneši atpakaļ
vecāks
revīzija
344c499462
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  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');