PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.3
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.3
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 / counter-box / index.js

index.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.3, at gutenberg/blocks/counter-box/index.js

62 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 deprecated from './deprecated';
4 import edit from './edit';
5 import save from './save';
6 import transforms from './transforms';
7
8 const { name } = metadata;
9
10 export { metadata, name };
11
12 export const settings = {
13 icon: getIcon('block-counter-box', true),
14 ghostkit: {
15 previewUrl: 'https://www.ghostkit.io/docs/blocks/number-box/',
16 customStylesCallback(attributes) {
17 const styles = {
18 '--gkt-counter-box--number__font-size': undefined,
19 '--gkt-counter-box--number__color':
20 attributes.numberColor || undefined,
21 '&:hover': {
22 '--gkt-counter-box--number__color':
23 attributes.hoverNumberColor || undefined,
24 },
25 };
26
27 if (
28 typeof attributes.numberSize !== 'undefined' &&
29 attributes.numberSize !== ''
30 ) {
31 styles['--gkt-counter-box--number__font-size'] =
32 `${attributes.numberSize}px`;
33 }
34
35 return styles;
36 },
37 },
38 example: {
39 attributes: {
40 number: '77',
41 numberColor: '#0366d6',
42 ghostkit: {
43 id: 'example-counter-box',
44 },
45 className: 'ghostkit-custom-example-counter-box',
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 deprecated,
61 };
62