grapesjs-style-gpickr

1.0.3 • Public • Published

Grapesjs Style Gpickr

DEMO

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-gpickr

Install dependencies

$ npm i

Start the dev server

$ npm start

Build the source

$ npm run build

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i grapesjs-style-gpickr

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

42.3 kB

Total Files

5

Last publish

Collaborators

  • ju99ernaut