vuepress-plugin-background
TypeScript icon, indicating that this package has built-in type declarations

1.2.6 • Public • Published

vuepress-plugin-background

基于vuepress的背景插件

示例

孤独的暖阳

开始

  • npm 安装:

    npm install vuepress-plugin-background
  • yarn 安装:

    yarn add vuepress-plugin-background

使用

在 vuepress 项目的配置文件(docs/.vuepress/config.ts)中导入插件方法 backPlugin,并在 plugins 选项中调用:

import { backPlugin } from 'vuepress-plugin-background';
export default defineUserConfig({
  plugins: [
      backPlugin()
  ]
});

配置

  • 如果不想修改配置,使用默认配置则直接调用backPlugin()即可。
  • 如果想自己配置,提供以下配置:

1、立方体

backPlugin({
    type: 'square',
    options:{
      //立体正方形在页面中的位置
      position:{right: '50px',top:'100px'},
      //立体正方形六个面的颜色
      color: [
        'rgba(171, 221, 164,0.4)',
        'rgba(102, 194, 165,0.4)',
        'rgba(50, 136, 189,0.4)',
        'rgba(254, 224, 139,0.4)',
        'rgba(244, 109, 67,0.4)',
        'rgba(213, 62, 79,0.4)',
      ]
    }
})

2、运动线条

backPlugin({
  type: 'normalLine',
  options:{
    //背景颜色
    backColor: ''
  }
})

许可证

MIT

Package Sidebar

Install

npm i vuepress-plugin-background

Weekly Downloads

1

Version

1.2.6

License

MIT

Unpacked Size

13.5 kB

Total Files

13

Last publish

Collaborators

  • sherrysr