Переглянути джерело

[REF-2878] Map fontFamily to fontFamily and --default-font-family (#3380)

When setting the font_family prop for a component, also set the radix token
`--default-font-family` so that child radix components will inherit the font.
Masen Furer 1 рік тому
батько
коміт
653f00b046
1 змінених файлів з 2 додано та 0 видалено
  1. 2 0
      reflex/style.py

+ 2 - 0
reflex/style.py

@@ -47,6 +47,8 @@ STYLE_PROP_SHORTHAND_MAPPING = {
     "marginY": ("marginTop", "marginBottom"),
     "marginY": ("marginTop", "marginBottom"),
     "bg": ("background",),
     "bg": ("background",),
     "bgColor": ("backgroundColor",),
     "bgColor": ("backgroundColor",),
+    # Radix components derive their font from this CSS var, not inherited from body or class.
+    "fontFamily": ("fontFamily", "--default-font-family"),
 }
 }