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
Asked
Active
Viewed 1,101 times
1 Answers
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
-
This will work but will affect all the pages right? I need to adjust the sidebar width for only one page – Selbin C R Aug 01 '21 at 06:30