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 / grid-column / index.js

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

51 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import '../grid/awb-fallback';
2
3 import getIcon from '../../utils/get-icon';
4 import getBackgroundStyles from '../grid/get-background-styles';
5 import metadata from './block.json';
6 import edit from './edit';
7 import save from './save';
8
9 const { name } = metadata;
10
11 export { metadata, name };
12
13 export const settings = {
14 icon: getIcon('block-grid-column', true),
15 ghostkit: {
16 customStylesCallback(attributes) {
17 const { stickyContent, stickyContentOffset } = attributes;
18
19 const styles = {
20 '--gkt-grid--column-sticky__offset': undefined,
21 ...getBackgroundStyles(attributes),
22 };
23
24 // Sticky styles.
25 if (
26 stickyContent &&
27 typeof stickyContentOffset !== 'undefined' &&
28 stickyContentOffset !== ''
29 ) {
30 styles['--gkt-grid--column-sticky__offset'] =
31 `${stickyContentOffset}px`;
32 }
33
34 return styles;
35 },
36 customStylesFilter(styles, data, isEditor, attributes) {
37 // change custom styles in Editor.
38 if (isEditor && attributes?.ghostkit?.id) {
39 // background.
40 styles = styles.replace(
41 new RegExp('> .nk-awb .jarallax-img', 'g'),
42 '> .awb-gutenberg-preview-block .jarallax-img'
43 );
44 }
45 return styles;
46 },
47 },
48 edit,
49 save,
50 };
51