How to change width of a sidebar in docusaurus

Viewed 562

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

1 Answers

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;
}
Related