![]() * Allow `Component.add_style` to return a regular dict It's more convenient to allow returning a regular dict without having to import and wrap the value in `rx.style.Style`. If the dict contains any Var or encoded VarData f-strings, these will be picked up when the plain dicts are passed to Style.update(). Because Style.update already merges VarData, there is no reason to explicitly merge it again in this function; this change keeps the merging logic inside the Style class. * Test for Style.update with existing Style with _var_data and kwargs Should retain the _var_data from the original Style instance * style: Avoid losing VarData in Style.update If a Style class with _var_data is passed to `Style.update` along with kwargs, then the _var_data was lost in the double-splat dictionary expansion. Instead, only apply the kwargs to an existing or new Style instance to retain _var_data and properly convert values. * add_style return annotation is Dict[str, Any] * nit: use lowercase dict in annotation |
||
---|---|---|
.. | ||
base | ||
core | ||
datadisplay | ||
el | ||
forms | ||
graphing | ||
layout | ||
lucide | ||
media | ||
radix | ||
typography | ||
__init__.py | ||
test_component_future_annotations.py | ||
test_component_state.py | ||
test_component.py | ||
test_tag.py |