├── .gitignore
├── LICENSE
├── README.md
├── index.html
├── package-lock.json
├── package.json
├── src
├── index.ts
└── styles.ts
└── tsconfig.json
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | private/
3 | node_modules/
4 | .eslintrc
5 | *.log
6 | _index.html
7 | dist/
8 | .npmrc
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016-current, Artur Arseniev
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification,
5 | are permitted provided that the following conditions are met:
6 |
7 | - Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 | - Redistributions in binary form must reproduce the above copyright notice, this
10 | list of conditions and the following disclaimer in the documentation and/or
11 | other materials provided with the distribution.
12 | - Neither the name "GrapesJS" nor the names of its contributors may be
13 | used to endorse or promote products derived from this software without
14 | specific prior written permission.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GrapesJS Style Gradient
2 |
3 | This plugins adds a new `gradient` property to the GrapesJS's StyleManager by using [Grapick](https://github.com/artf/grapick)
4 |
5 | > Requires GrapesJS v0.20.1 or higher
6 |
7 | [Demo](https://codepen.io/artf/full/bYwdQG/)
8 |
9 | ## Summary
10 |
11 | * Plugin name: `grapesjs-style-gradient`
12 | * Style type: `gradient` (the gradient picker input)
13 | * Built-in Style property: `background-image` (composite type with gradient picker and direction/type selectors)
14 |
15 |
16 |
17 |
18 |
19 | ## Options
20 |
21 | | Option | Description | Default |
22 | |-|-|-
23 | | `grapickOpts` | [Grapick options](https://github.com/artf/grapick#configurations). | `{}` |
24 | | `colorPicker` | Custom color picker, check [Grapick's repo](https://github.com/artf/grapick#add-custom-color-picker) to get more about it. | `undefined` |
25 | | `selectEdgeStops` | Select, by default, the edge color stops of the gradient picker. | `true` |
26 | | `styleType` | The id to assign for the gradient picker type. | `'gradient'` |
27 | | `builtInType` | Built-in property name to use for the composite type with the gradient picker and direction/type selectors. | `'background-image'` |
28 |
29 |
30 |
31 |
32 |
33 | ## Download
34 |
35 | * CDN
36 | * `https://unpkg.com/grapesjs-style-gradient`
37 | * NPM
38 | * `npm i grapesjs-style-gradient`
39 | * GIT
40 | * `git clone https://github.com/GrapesJS/style-gradient.git`
41 |
42 |
43 |
44 |
45 |
46 | ## Usage
47 |
48 | Directly in the browser.
49 | ```html
50 |
51 |
52 |
53 |
54 |
55 |
50 | This is a demo content from index.html. For the development, you shouldn't edit this file, instead you can
51 | copy and rename it to _index.html, on next server start the new file will be served, and it will be ignored by git.
52 |