| 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 |
|