Drawer component styles should only be in css dict (#2640)
This commit is contained in:
parent
10984ef869
commit
3f24b42260
@ -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):
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user