Skip to main content
Version: 3.5.1

📦 theme-classic

Docusaurus 的经典主题。

¥The classic theme for Docusaurus.

有关配置的更多详细信息,你可以参考 主题配置页面

¥You can refer to the theme configuration page for more details on the configuration.

npm install --save @docusaurus/theme-classic
提示

如果你已经安装了 @docusaurus/preset-classic,则无需将其安装为依赖。

¥If you have installed @docusaurus/preset-classic, you don't need to install it as a dependency.

配置

¥Configuration

接受的字段:

¥Accepted fields:

选项类型默认描述
customCssstring[] | string[]将作为 客户端模块 全局导入的样式表。相对路径根据站点目录进行解析。
注意

主题的大部分配置是在 themeConfig 中完成的,可以在 主题配置 中找到。

¥Most configuration for the theme is done in themeConfig, which can be found in theme configuration.

配置示例

¥Example configuration

你可以通过预设选项或插件选项配置此主题。

¥You can configure this theme through preset options or plugin options.

提示

大多数 Docusaurus 用户通过预设选项配置此插件。

¥Most Docusaurus users configure this plugin through the preset options.

If you use a preset, configure this plugin through the preset options:

docusaurus.config.js
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
theme: {
customCss: './src/css/custom.css',
},
},
],
],
};