quarto

How to change the style of the section titles in a Quarto website sidebar?


I'm still struggling with setting up a Quarto website. In Quarto, the sidebar often has content. The styling of the sidebar, if I'm not mistaken, is inherited from the default themes. Imagining that I have a content with two levels:

Animals

  • animal 1

Basics

  • basic 1

Question: how to control the style of the first level headers, i.e. to make Animals, Basics and Humans bold, while leaving the rest of the formatting as it is.

Animals

  • animal 1

Basics

  • basic 1

Update

_quarto.yml

website:
  title: "Some fantastic site"
  page-navigation: true
  reader-mode: true
  bread-crumbs: false
  navbar:
    left:
      - href: index.qmd
        text: Home
      - about.qmd

 sidebar:
    style: "docked"
    search: true
    contents: auto

format:
    html:
      theme: cosmo
      css: styles.css
      toc: true

index.qmd in the main folder has nothing but the title. How to make header content elements bold in the sidebar?


Solution

  • You can target the first level headers and make them bold like this:

    styles.css

    .sidebar-item-text.sidebar-link.text-start {
        font-weight: bold;
    }
    

    enter image description here