I am trying to style the header of cards that are rendered by pn.Accordion, when I try to apply styles to a specific class, it does not work, minimal reproducer below, ACCORDION_STYLESHEET1
works but ACCORDION_STYLESHEET2
doesn’ t work:
import panel as pn
pn.extension()
DATA = {
'Category 1': ['a', 'b'],
'Category 2': ['c', 'd']
}
# This CSS is respected
ACCORDION_STYLESHEET1 = """
.bk-panel-models-layout-Card.accordion{
width: 800px !important
}
"""
# This CSS is not!
ACCORDION_STYLESHEET2 = """
.bk-panel-models-markup-HTML.card-title{
margin: 0px !important;
}
"""
acc = pn.Accordion(*[(k, pn.Column(*[pn.pane.Markdown(x) for x in v])) for k,v in DATA.items()], stylesheets=[ACCORDION_STYLESHEET1, ACCORDION_STYLESHEET2] )
pn.serve(acc)
I am not able to understand the reason for this. I selected the classes by inspecting the specific element that I want to target. How can I make this to work?