3

I want to change the sidebar width in docusaurus, I am only allowed to change the width of sidebar in a particular page.Can anyone suggest me a solution

Selbin C R
  • 31
  • 2

1 Answers1

6

In version ~2.0.0 you can create your own CSS files (/src/css/custom.css) by defining it in the docusaurus.config.js. There you can set your override styles. When inspecting the page, there's Docusaurus sets the variable for --doc-sidebar-width: 300px; I was able to override that variable with an !important:

:root { 
    --doc-sidebar-width: 250px !important;
}
Joseph Carey
  • 106
  • 1
  • 4