PluginProbe
GutSlider – All in One Slider and Carousel Blocks for Gutenberg / 2.11.0
GutSlider – All in One Slider and Carousel Blocks for Gutenberg v2.11.0
3.1.0 3.0.0 2.13.2 2.13.1 2.13.0 trunk 1.0.0 2.1.0 2.10.0 2.10.1 2.11.0 2.11.1 2.11.2 2.11.3 2.11.4 2.12.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.1 2.5.3 2.5.4 2.5.5 2.6.1 All 56 releases
slider-blocks / src / generators / styles / background-control.js

background-control.js in GutSlider – All in One Slider and Carousel Blocks for Gutenberg 2.11.0, at src/generators/styles/background-control.js

29 lines 740 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const generateBgStyles = ({ controlName, attributes }) => {
2 const {
3 [`${controlName}bgType`]: bgType = 'classic',
4 [`${controlName}bgColor`]: bgColor,
5 [`${controlName}bgGradient`]: bgGradient
6 } = attributes;
7
8 let bgStyle;
9 if (bgType === 'classic' && bgColor !== undefined && bgColor !== '') {
10 bgStyle = bgColor
11 ? `background-color: ${bgColor};
12 `
13 : '';
14 } else if (bgType === 'gradient' && bgGradient !== undefined && bgGradient !== '') {
15 bgStyle = bgGradient
16 ? `background-image: ${bgGradient};
17 `
18 : '';
19 } else {
20 bgStyle = '';
21 }
22
23 return {
24 bgStyle
25 };
26 };
27
28 export default generateBgStyles;
29