|
@@ -461,6 +461,14 @@ class Component(Base, ABC):
|
|
|
child.add_style(style)
|
|
|
return self
|
|
|
|
|
|
+ def _get_style(self) -> dict:
|
|
|
+ """Get the style for the component.
|
|
|
+
|
|
|
+ Returns:
|
|
|
+ The dictionary of the component style as value and the style notation as key.
|
|
|
+ """
|
|
|
+ return {"sx": self.style}
|
|
|
+
|
|
|
def render(self) -> Dict:
|
|
|
"""Render the component.
|
|
|
|
|
@@ -472,9 +480,9 @@ class Component(Base, ABC):
|
|
|
tag.add_props(
|
|
|
**self.event_triggers,
|
|
|
key=self.key,
|
|
|
- sx=self.style,
|
|
|
id=self.id,
|
|
|
class_name=self.class_name,
|
|
|
+ **self._get_style(),
|
|
|
**self.custom_attrs,
|
|
|
).set(
|
|
|
children=[child.render() for child in self.children],
|