From 3f24b422607f4e9938e45ffff14d3dbc773f40bc Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Fri, 16 Feb 2024 17:41:02 +0000 Subject: [PATCH] Drawer component styles should only be in css dict (#2640) --- reflex/components/radix/primitives/drawer.py | 28 +++----------------- reflex/components/tags/tag.py | 6 ++++- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/reflex/components/radix/primitives/drawer.py b/reflex/components/radix/primitives/drawer.py index b268180aa..76fc5ab2f 100644 --- a/reflex/components/radix/primitives/drawer.py +++ b/reflex/components/radix/primitives/drawer.py @@ -119,12 +119,7 @@ class DrawerContent(DrawerComponent): } style = self.style or {} base_style.update(style) - self.style.update( - { - "css": base_style, - } - ) - return self.style + return {"css": base_style} def get_event_triggers(self) -> Dict[str, Any]: """Get the events triggers signatures for the component. @@ -188,12 +183,7 @@ class DrawerOverlay(DrawerComponent): } style = self.style or {} base_style.update(style) - self.style.update( - { - "css": base_style, - } - ) - return self.style + return {"css": base_style} class DrawerClose(DrawerComponent): @@ -226,12 +216,7 @@ class DrawerTitle(DrawerComponent): } style = self.style or {} base_style.update(style) - self.style.update( - { - "css": base_style, - } - ) - return self.style + return {"css": base_style} class DrawerDescription(DrawerComponent): @@ -253,12 +238,7 @@ class DrawerDescription(DrawerComponent): } style = self.style or {} base_style.update(style) - self.style.update( - { - "css": base_style, - } - ) - return self.style + return {"css": base_style} class Drawer(ComponentNamespace): diff --git a/reflex/components/tags/tag.py b/reflex/components/tags/tag.py index 6bb53a428..27b5dc7c1 100644 --- a/reflex/components/tags/tag.py +++ b/reflex/components/tags/tag.py @@ -62,11 +62,15 @@ class Tag(Base): Returns: The tag with the props added. """ + from reflex.components.core.colors import Color + self.props.update( { format.to_camel_case(name, allow_hyphens=True): prop if types._isinstance(prop, Union[EventChain, dict]) - else Var.create(prop) + else Var.create( + prop, _var_is_string=isinstance(prop, Color) + ) # rx.color is always a string for name, prop in kwargs.items() if self.is_valid_prop(prop) }