5

I like to tweak the styles (e.g. background-color, font) of the TOC of the Bookdown, Gitbook style HTML document. Is this possible? If so, can someone be kind enough to point me to where I can start to do this? Thank you.

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419

1 Answers1

2

Two steps:

1) Use a custom style.css file. 2) Reference style.css in the _output.yml file.

The TOC has the li class. Your style.css file looks like this if you want to have all TOC items in blood:

style.css

li {
  font-weight: bold;
}

_output.yml

bookdown::gitbook:
  css: style.css

There are other styles that can be modified. For example:

R Bookdown - Customize width of TOC/Sidebar