mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-09 05:16:23 +10:00
feat($plugin-nprogress): allow nprogress use different color and add docs (#1366)
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
$nprogressColor ?= $accentColor
|
||||
|
||||
#nprogress
|
||||
pointer-events none
|
||||
.bar
|
||||
background $accentColor
|
||||
background $nprogressColor
|
||||
position fixed
|
||||
z-index 1031
|
||||
top 0
|
||||
@@ -14,7 +16,7 @@
|
||||
right 0px
|
||||
width 100px
|
||||
height 100%
|
||||
box-shadow 0 0 10px $accentColor, 0 0 5px $accentColor
|
||||
box-shadow 0 0 10px $nprogressColor, 0 0 5px $nprogressColor
|
||||
opacity 1.0
|
||||
transform rotate(3deg) translate(0px, -4px)
|
||||
.spinner
|
||||
@@ -28,8 +30,8 @@
|
||||
height 18px
|
||||
box-sizing border-box
|
||||
border solid 2px transparent
|
||||
border-top-color $accentColor
|
||||
border-left-color $accentColor
|
||||
border-top-color $nprogressColor
|
||||
border-left-color $nprogressColor
|
||||
border-radius 50%
|
||||
animation nprogress-spinner 400ms linear infinite
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ function getGuideSidebar (groupA, groupB) {
|
||||
const officalPlugins = fs
|
||||
.readdirSync(path.resolve(__dirname, '../plugin/official'))
|
||||
.map(filename => 'official/' + filename.slice(0, -3))
|
||||
.sort()
|
||||
|
||||
function getPluginSidebar (pluginTitle, pluginIntro, officialPluginTitle) {
|
||||
return [
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: nprogress
|
||||
metaTitle: Nprogress Plugin | VuePress
|
||||
---
|
||||
|
||||
# [@vuepress/plugin-nprogress](https://github.com/vuejs/vuepress/tree/master/packages/%40vuepress/plugin-nprogress)
|
||||
|
||||
> Nprogress plugin
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
yarn add -D @vuepress/plugin-nprogress
|
||||
# OR npm install -D @vuepress/plugin-nprogress
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
module.exports = {
|
||||
plugins: ['@vuepress/nprogress']
|
||||
}
|
||||
```
|
||||
|
||||
## Custom color
|
||||
|
||||
Set `$nprogressColor` in your __site__ or __theme__ `palette.styl` file to change the color of the progress bar (default is `$accentColor`).
|
||||
|
||||
```stylus
|
||||
// .vuepress/styles/palette.styl
|
||||
// or
|
||||
// .vuepress/theme/styles/palette.styl
|
||||
|
||||
$nprogressColor = red
|
||||
```
|
||||
|
||||
**Also see:**
|
||||
|
||||
- [Config Reference > Styling](../../config/#styling)
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: nprogress
|
||||
metaTitle: Nprogress 插件 | VuePress
|
||||
---
|
||||
|
||||
# [@vuepress/plugin-nprogress](https://github.com/vuejs/vuepress/tree/master/packages/%40vuepress/plugin-nprogress)
|
||||
|
||||
> Nprogress plugin
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
yarn add -D @vuepress/plugin-nprogress
|
||||
# 或者 npm install -D @vuepress/plugin-nprogress
|
||||
```
|
||||
|
||||
## 使用
|
||||
|
||||
```javascript
|
||||
module.exports = {
|
||||
plugins: ['@vuepress/nprogress']
|
||||
}
|
||||
```
|
||||
|
||||
## 自定义颜色
|
||||
|
||||
在你的 __site__ 或 __theme__ 的 `palette.styl` 文件中设置 `$nprogressColor` 来改变进度条的颜色(默认使用 `$accentColor`)。
|
||||
|
||||
```stylus
|
||||
// .vuepress/styles/palette.styl
|
||||
// 或者
|
||||
// .vuepress/theme/styles/palette.styl
|
||||
|
||||
$nprogressColor = red
|
||||
```
|
||||
|
||||
**参考:**
|
||||
|
||||
- [配置 > Styling](../../config/#styling)
|
||||
Reference in New Issue
Block a user