有没有办法覆盖文档侧边栏的 CSS(使用 Docusaurus)使其 narrower/further 位于左侧?
Is there a way to override the CSS for the doc-sidebar (using Docusaurus) to make it narrower/further to the left?
我一直在试用 Docusaurus 来做一些文档。唯一的问题是我想要更多 space 页面本身而不是侧面 bar/toc。我正在使用预设经典。我试过在 custom.css 中覆盖 --doc-sidebar-width
但没有任何改变。还有其他方法吗?
你走对了,只需添加!important
。
对于可能需要它的其他人。在文件 .\src\css\custom.css
中,添加:
:root {
--doc-sidebar-width: 220px !important;
}
我一直在试用 Docusaurus 来做一些文档。唯一的问题是我想要更多 space 页面本身而不是侧面 bar/toc。我正在使用预设经典。我试过在 custom.css 中覆盖 --doc-sidebar-width
但没有任何改变。还有其他方法吗?
你走对了,只需添加!important
。
对于可能需要它的其他人。在文件 .\src\css\custom.css
中,添加:
:root {
--doc-sidebar-width: 220px !important;
}