grapesjs-style-gpickr
v1.0.3
Published
Grapesjs Style Gpickr
Readme
Grapesjs Style Gpickr
Adds a gradient picker for adding background gradients. To setup correctly check index.html
HTML
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="https://unpkg.com/grapesjs-style-gpickr"></script>
<div id="gjs"></div>JS
const editor = grapesjs.init({
container: '#gjs',
height: '100%',
fromElement: true,
storageManager: false,
plugins: ['grapesjs-style-gpickr'],
});CSS
body, html {
margin: 0;
height: 100%;
}Summary
- Plugin name:
grapesjs-style-gpickr
Options
| Option | Description | Default |
|-|-|-
| gpickrOpts | gpickr configuration | {} |
Download
- CDN
https://unpkg.com/grapesjs-style-gpickr
- NPM
npm i grapesjs-style-gpickr
- GIT
git clone https://github.com/Ju99ernaut/grapesjs-style-gpickr.git
Usage
Directly in the browser
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/>
<script src="https://unpkg.com/grapesjs"></script>
<script src="path/to/grapesjs-style-gpickr.min.js"></script>
<div id="gjs"></div>
<script type="text/javascript">
var editor = grapesjs.init({
container: '#gjs',
// ...
plugins: ['grapesjs-style-gpickr'],
pluginsOpts: {
'grapesjs-style-gpickr': { /* options */ }
}
});
</script>Modern javascript
import grapesjs from 'grapesjs';
import plugin from 'grapesjs-style-gpickr';
import 'grapesjs/dist/css/grapes.min.css';
const editor = grapesjs.init({
container : '#gjs',
// ...
plugins: [plugin],
pluginsOpts: {
[plugin]: { /* options */ }
}
// or
plugins: [
editor => plugin(editor, { /* options */ }),
],
});Development
Clone the repository
$ git clone https://github.com/Ju99ernaut/grapesjs-style-gpickr.git
$ cd grapesjs-style-gpickrInstall dependencies
$ npm iStart the dev server
$ npm startBuild the source
$ npm run buildLicense
MIT
