Skip to content

Commit

Permalink
feat(widget): Allow style attr to be dict
Browse files Browse the repository at this point in the history
  • Loading branch information
schencej committed Oct 28, 2023
1 parent 3406942 commit 11f4ca5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions trame_client/widgets/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ def __init__(self, _elem_name, children=None, **kwargs):
)
self._event_names = kwargs.get("__events", []) + SHARED_EVENTS

style = kwargs.get("style", None)
if type(style) is dict:
kwargs["style"] = " ".join([f"{k}: {v};" for k, v in style.items()])

self._attributes = {}
self._py_attr = kwargs
self._children = []
Expand Down

0 comments on commit 11f4ca5

Please sign in to comment.