Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xiaoluoboding/vuepress-plugin-hero-pattern

🌠A Hero Patterns achievement for VuePress
https://github.com/xiaoluoboding/vuepress-plugin-hero-pattern

svg svg-patterns vuepress vuepress-plugin

Last synced: about 2 months ago
JSON representation

🌠A Hero Patterns achievement for VuePress

Awesome Lists containing this project

README

        

# Vuepress Plugin HeroPattern









Register a global `` component for VuePress.

This component generate a seemless SVG background pattern as a background image.

> This plugin is a VuePress implementation of [Hero Patterns](http://www.heropatterns.com/), All 87 unstyled svg icons is optimized with svgo.

## See Demo on CodeSandbox

[![Edit vuepress-plugin-hero-pattern](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/vuepress-plugin-hero-pattern-o1ebr?fontsize=14&hidenavigation=1&theme=dark)

## Installation

```bash
yarn add vuepress-plugin-hero-pattern -S
or
npm i vuepress-plugin-hero-pattern -S
```

## Register the plugin

```js
...
module.exports = {
...,
plugins: {
['hero-pattern']
},
...
}
...
```

## Usage

### Default

I pick `line-to-motion` as the preset pattern.

> Only background image, you must give the height of the element

```vue

```

### Pick a Pattern

Hero Pattern provide 87 kinds of pattern you can choose, check [pattern list](https://github.com/xiaoluoboding/vuepress-plugin-hero-pattern/tree/master/assets/icons)

```vue

```

### With the custom slot

> In the case, you can let the slot element control the pattern's height

```vue


All Posts

```

## API

| Props | Description | Type | Default |
| :---: | :---------: | :--: | :-----: |
| pattern | 87 kinds of patterns that Hero Patterns supported, check [pattern list](https://github.com/xiaoluoboding/vuepress-plugin-hero-pattern/tree/master/assets/icons) | String | `line-to-motion` |
| fillColor | Controls the foreground color of the generated image. | String | `#9c92ac` |
| fillOpacity | Controls the foreground opacity of the generated image. | String | `0.4` |
| backgroundColor | Controls the background color of the generated image. | String | `#dfdbe5` |
| repeat | Controls how the background repeated of the generated image. | String | `repeat` |

## Slot

`` component provide a custom slot, you can write some element on the generated pattern.

## Related VuePress Plugin

* [vuepress-plugin-geopattern](https://github.com/xiaoluoboding/vuepress-plugin-geopattern) - GeoPattern is a geopattern adapter for VuePress.

## License

MIT @ [xiaoluoboding](https://github.com/xiaoluoboding)