Skip to content

docs($zh): update custom page class for default theme config #2719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/docs/docs/zh/theme/default-theme-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,16 +508,20 @@ pageClass: custom-page-class
---
```

然后你就可以写专门针对该页面的 CSS
只能在 `.vuepress/styles/index.styl` 中编写针对该页面的 CSS :

``` css
/* .vuepress/override.styl */
/* .vuepress/styles/index.styl */

.theme-container.custom-page-class {
/* 特定页面的 CSS */
}
```

::: tip 注意
自定义样式应该写在 [index.styl](/config/#index-styl) 内, 该文件可以让你方便地添加或覆盖样式.
:::

## 特定页面的自定义布局

默认情况下,每个 `*.md` 文件将会被渲染在一个 `<div class="page">` 容器中,同时还有侧边栏、自动生成的编辑链接,以及上 / 下一篇文章的链接。如果你想要使用一个完全自定义的组件来代替当前的页面(而只保留导航栏),你可以再次使用 `YAML front matter` 来指定这个组件。
Expand Down