PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.2
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.2
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 / alert / index.js

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

61 lines 1.3 KB
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 import transforms from './transforms';
6
7 const { name } = metadata;
8
9 export { metadata, name };
10
11 export const settings = {
12 icon: getIcon('block-alert', true),
13 ghostkit: {
14 previewUrl: 'https://www.ghostkit.io/docs/blocks/alert/',
15 customStylesCallback(attributes) {
16 const styles = {
17 '--gkt-alert__border-color': attributes.color || undefined,
18 '--gkt-alert--icon__font-size': undefined,
19 '--gkt-alert--icon__color': attributes.color || undefined,
20 '&:hover': {
21 '--gkt-alert__border-color':
22 attributes.hoverColor || undefined,
23 '--gkt-alert--icon__color':
24 attributes.hoverColor || undefined,
25 },
26 };
27
28 if (
29 typeof attributes.iconSize !== 'undefined' &&
30 attributes.iconSize !== ''
31 ) {
32 styles['--gkt-alert--icon__font-size'] =
33 `${attributes.iconSize}px`;
34 }
35
36 return styles;
37 },
38 },
39 example: {
40 attributes: {
41 color: '#E47F3B',
42 ghostkit: {
43 id: 'example-alert',
44 },
45 className: 'ghostkit-custom-example-alert',
46 },
47 innerBlocks: [
48 {
49 name: 'core/paragraph',
50 attributes: {
51 content:
52 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.',
53 },
54 },
55 ],
56 },
57 edit,
58 save,
59 transforms,
60 };
61