2018-07-01 07:27:01 -04:00
|
|
|
|
# 主题
|
|
|
|
|
|
|
|
|
|
目前提供三套主题可供选择,模仿 [Vue](//vuejs.org) 和 [buble](//buble.surge.sh) 官网订制的主题样式。还有 [@liril-net](https://github.com/liril-net) 贡献的黑色风格的主题。
|
|
|
|
|
|
|
|
|
|
```html
|
2020-04-26 01:54:44 -04:00
|
|
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/vue.css">
|
|
|
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/buble.css">
|
|
|
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/dark.css">
|
|
|
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/pure.css">
|
|
|
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/dolphin.css">
|
2018-07-01 07:27:01 -04:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
!> CSS 的压缩文件位于 `/lib/themes/`
|
|
|
|
|
|
|
|
|
|
```html
|
2020-04-26 01:54:44 -04:00
|
|
|
|
<!-- compressed -->
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
|
|
|
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/buble.css">
|
|
|
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/dark.css">
|
|
|
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/pure.css">
|
|
|
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/dolphin.css">
|
2018-07-01 07:27:01 -04:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
如果你有其他想法或者想开发别的主题,欢迎提 [PR](https://github.com/docsifyjs/docsify/pulls)。
|
|
|
|
|
|
|
|
|
|
#### 点击切换主题
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="demo-theme-preview">
|
|
|
|
|
<a data-theme="vue">vue.css</a>
|
|
|
|
|
<a data-theme="buble">buble.css</a>
|
|
|
|
|
<a data-theme="dark">dark.css</a>
|
|
|
|
|
<a data-theme="pure">pure.css</a>
|
2019-04-04 22:28:59 -04:00
|
|
|
|
<a data-theme="dolphin">dolphin.css</a>
|
2018-07-01 07:27:01 -04:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.demo-theme-preview a {
|
|
|
|
|
padding-right: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.demo-theme-preview a:hover {
|
|
|
|
|
cursor: pointer;
|
2020-04-26 01:54:44 -04:00
|
|
|
|
text-decoration: underline;
|
2018-07-01 07:27:01 -04:00
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
var preview = Docsify.dom.find('.demo-theme-preview');
|
|
|
|
|
var themes = Docsify.dom.findAll('[rel="stylesheet"]');
|
|
|
|
|
|
|
|
|
|
preview.onclick = function (e) {
|
|
|
|
|
var title = e.target.getAttribute('data-theme')
|
|
|
|
|
|
|
|
|
|
themes.forEach(function (theme) {
|
|
|
|
|
theme.disabled = theme.title !== title
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
2019-01-06 22:55:06 -05:00
|
|
|
|
## 其他主题
|
2018-07-01 07:27:01 -04:00
|
|
|
|
|
2019-01-06 22:55:06 -05:00
|
|
|
|
- [docsify-themeable](https://jhildenbiddle.github.io/docsify-themeable/#/) 一个用于docsify的,简单到令人愉悦的主题系统.
|