2017-02-12 15:51:26 +08:00
|
|
|
# 主题
|
|
|
|
|
2017-02-13 22:43:58 +08:00
|
|
|
目前提供三套主题可供选择,模仿 [Vue](//vuejs.org) 和 [buble](//buble.surge.sh) 官网订制的主题样式。还有 [@liril-net](https://github.com/liril-net) 贡献的黑色风格的主题。
|
2017-02-12 15:51:26 +08:00
|
|
|
|
|
|
|
```html
|
|
|
|
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
|
|
|
|
<link rel="stylesheet" href="//unpkg.com/docsify/themes/buble.css">
|
2017-02-13 22:43:58 +08:00
|
|
|
<link rel="stylesheet" href="//unpkg.com/docsify/themes/dark.css">
|
2017-03-12 05:13:25 +08:00
|
|
|
<link rel="stylesheet" href="//unpkg.com/docsify/themes/pure.css">
|
2017-02-12 15:51:26 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
!> CSS 的压缩文件位于 `/lib/themes/`
|
|
|
|
|
2017-03-12 05:13:25 +08:00
|
|
|
```html
|
|
|
|
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
|
|
|
|
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/buble.css">
|
|
|
|
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/dark.css">
|
|
|
|
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/pure.css">
|
|
|
|
```
|
|
|
|
|
2017-02-18 23:04:52 +08:00
|
|
|
如果你有其他想法或者想开发别的主题,欢迎提 [PR](https://github.com/QingWei-Li/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>
|
2017-03-12 05:13:25 +08:00
|
|
|
<a data-theme="pure">pure.css</a>
|
2017-02-18 23:04:52 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.demo-theme-preview a {
|
|
|
|
padding-right: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.demo-theme-preview a:hover {
|
|
|
|
text-decoration: underline;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
</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>
|