PluginProbe
Genesis Blocks / trunk
Genesis Blocks vtrunk
3.1.11 trunk 1.0.0 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 3.0.0 3.0.1 3.1.0 3.1.1 3.1.10 All 32 releases
genesis-blocks / src / utils / components / background-image / classes.js

classes.js in Genesis Blocks trunk, at src/utils/components/background-image/classes.js

28 lines 744 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { dimRatioToClass } from './shared';
2
3 /**
4 * Background image classes.
5 *
6 * @param {Object} attributes
7 */
8 function BackgroundImageClasses(attributes) {
9 return [
10 attributes.backgroundDimRatio !== undefined &&
11 100 !== attributes.backgroundDimRatio
12 ? 'gb-has-background-dim'
13 : null,
14 dimRatioToClass(attributes.backgroundDimRatio),
15 attributes.backgroundImgURL &&
16 attributes.backgroundSize &&
17 'no-repeat' === attributes.backgroundRepeat
18 ? 'gb-background-' + attributes.backgroundSize
19 : null,
20 attributes.backgroundImgURL && attributes.backgroundRepeat
21 ? 'gb-background-' + attributes.backgroundRepeat
22 : null,
23 attributes.hasParallax ? 'gb-has-parallax' : null,
24 ];
25 }
26
27 export default BackgroundImageClasses;
28