GitHub - GrapesJS/style-gradient: Add gradient input to the Style Manager in GrapesJS (original) (raw)
This plugins adds a new gradient
property to the GrapesJS's StyleManager by using Grapick
Directly in the browser.
import grapesjs from 'grapesjs'; import plugin from 'grapesjs-style-gradient';
const editor = grapesjs.init({ container : '#gjs', // ... plugins: [plugin], pluginsOpts: { [plugin]: { /* options */ } } });
// Usage via API
// Add gradient picker as a single input editor.StyleManager.addProperty('decorations', { type: 'gradient', // <- new type name: 'Gradient', property: 'background-image', defaults: 'none' full: true, });
// Add the new background-image bulti-in type editor.StyleManager.addProperty('decorations', { extend: 'background-image', // <- extend the built-in type name: 'Gradient Background', });