Search code examples
cssdocusaurus

Is there a way to override the CSS for the doc-sidebar (using Docusaurus) to make it narrower/further to the left?


I've been trying out Docusaurus for doing some documentation. Only problem is that I'd like more space for the page itself rather than the side bar/toc. I'm using preset-classic. I've tried overriding --doc-sidebar-width in custom.css but nothing changes. Is there another way to do this?


Solution

  • You are in the right path, just add !important.

    For others who may need this. In the file .\src\css\custom.css, add:

    :root {
         --doc-sidebar-width: 220px !important;
    }