ember-arcgis-page-layout
Version:
Page Layout infrastructure components
23 lines (22 loc) • 762 B
JavaScript
export default function getSectionStyle(styleObject) {
if (!styleObject) {
return '';
}
let style = '';
if (styleObject.background) {
if (styleObject.background.color) {
style = style + ` background-color: ${styleObject.background.color};`;
}
if (styleObject.background.image){
if(styleObject.background.darken) {
style = style + ` background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url(${styleObject.background.image}); background-size: cover;`;
}else{
style = style + ` background-image: url(${styleObject.background.image}); background-size: cover;`;
}
}
if (styleObject.color) {
style = style + ` color: ${styleObject.color}`;
}
}
return style.trim();
}