diff --git a/panel/chat/feed.py b/panel/chat/feed.py index 115ff11203..df46232a16 100644 --- a/panel/chat/feed.py +++ b/panel/chat/feed.py @@ -254,6 +254,11 @@ def __init__(self, *objects, **params): **linked_params ) card_params = linked_params.copy() + card_stylesheets = ( + self._stylesheets + + self.param.stylesheets.rx() + + self.param.card_params.rx().get('stylesheets', []) + ) card_params.update( margin=self.param.margin, align=self.param.align, @@ -267,9 +272,11 @@ def __init__(self, *objects, **params): min_height=self.param.min_height, title_css_classes=["chat-feed-title"], styles={"padding": "0px"}, - stylesheets=self._stylesheets + self.param.stylesheets.rx(), + stylesheets=card_stylesheets ) - card_params.update(self.card_params) + card_overrides = self.card_params.copy() + card_overrides.pop('stylesheets', None) + card_params.update(card_overrides) self.link(self._chat_log, objects='objects', bidirectional=True) # we have a card for the title self._card = Card( @@ -303,7 +310,9 @@ def _cleanup(self, root: Model | None = None) -> None: @param.depends("card_params", watch=True) def _update_card_params(self): - self._card.param.update(**self.card_params) + card_params = self.card_params.copy() + card_params.pop('stylesheets', None) + self._card.param.update(**card_params) @param.depends("placeholder_text", watch=True, on_init=True) def _update_placeholder(self): diff --git a/panel/chat/interface.py b/panel/chat/interface.py index 8642dc4e25..a612a53be9 100644 --- a/panel/chat/interface.py +++ b/panel/chat/interface.py @@ -164,7 +164,6 @@ def __init__(self, *objects, **params): self._card.param.update( objects=self._card.objects + [self._input_container], css_classes=["chat-interface"], - stylesheets=self._stylesheets, ) def _link_disabled_loading(self, obj: Viewable):