Skip to content

Commit

Permalink
Merge pull request #15 from schencej/dev
Browse files Browse the repository at this point in the history
Allow style attribute to be a dictionary
  • Loading branch information
jourdain authored Dec 1, 2023
2 parents c5cdc58 + 11f4ca5 commit 326fcbe
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 326fcbe

Please sign in to comment.