Working minimal example, apply css to TabPanel

Attempting to modify the font-size of a TabPanel title, have followed other similar topics without success. A minimal example is below.

-- templates
---- index.html
---- styles.css

from import curdoc
from bokeh.models import Tabs, TabPanel
from bokeh.layouts import column

doc = curdoc()
    TabPanel(child=column(), title='tab1'),
    TabPanel(child=column(), title='tab2')]))


{% extends base %}
{% block contents %}
  {% include 'styles.css' %}
{{ super() }}
{% endblock %}


.bk-tab {
background-color: red;

The app then appears without the red background applied to the tabs.

bokeh serve app --show

I do see the css code showing up in the page source -

    <script type="text/javascript">

  .bk-tab {
background-color: red;
    <div id="edce36a3-2f28-442e-92bd-14e41c060ee7" data-root-id="p1005" style="display: contents;"></div>

    <script type="application/json" id="e7c071bf-0465-455b-81a4-ce0a501df462">

Any idea what can change to make this all work?
Thank you for the support!

In bokeh 3.0 we migrated to “Web Components”, thus CSS of every bokeh’s component is isolated from everything else, and so any custom styles have to be added to components. Most globally defined CSS has no effect on bokeh’s components (except for font definitions, CSS variables, etc.).

You need to do the following:

tabs = Tabs(tabs=[
    TabPanel(child=column(), title='tab1'),
    TabPanel(child=column(), title='tab2'),
.bk-tab {
  background-color: red;

We are currently in process (for bokeh 3.5) of defining a theming mechanism based on CSS variables, which will allow to use a single global stylesheet again.

Hi @mateusz that worked, thank you very much for the support and I should have let you know I am using bokeh 3.4. I do like the ability to isolate css by bokeh component and I hope that feature will not be deprecated. I’m also looking forward to progress widgets (here) in bokeh 3.5. If you need advanced testing for bokeh 3.5 please let me know.