PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.4.1
Block Animations, Motion & Scroll Effects – Ghost Kit v3.4.1
3.7.2 3.7.1 3.7.0 3.6.1 trunk 1.6.3 2.25.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.6.0
ghostkit / gutenberg / blocks / icon / index.js

index.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.4.1, at gutenberg/blocks/icon/index.js

45 lines 1020 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import getIcon from '../../utils/get-icon';
2 import metadata from './block.json';
3 import edit from './edit';
4 import save from './save';
5
6 const { name } = metadata;
7 export { metadata, name };
8
9 export const settings = {
10 icon: getIcon('block-icon', true),
11 ghostkit: {
12 previewUrl: 'https://www.ghostkit.io/docs/blocks/icon/',
13 customStylesCallback(attributes) {
14 const {
15 justify,
16 width,
17 color,
18 backgroundColor,
19 backgroundGradient,
20 } = attributes;
21 const styles = {
22 '--gkt-icon__color': color || undefined,
23 '--gkt-icon__background':
24 backgroundColor || backgroundGradient || undefined,
25 '--gkt-icon__width': undefined,
26 '--gkt-icon__justify': undefined,
27 };
28
29 if (justify === 'start') {
30 styles['--gkt-icon__justify'] = 'flex-start';
31 } else if (justify === 'end') {
32 styles['--gkt-icon__justify'] = 'flex-end';
33 }
34
35 if (typeof width !== 'undefined' && width !== '') {
36 styles['--gkt-icon__width'] = width;
37 }
38
39 return styles;
40 },
41 },
42 edit,
43 save,
44 };
45