Skip to content

Commit cb0d90e

Browse files
more logic so that backgroundColor style does not get erased when setting text-color in UE
1 parent 9826990 commit cb0d90e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

blocks/columns/columns.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ export default function decorate(block) {
2020
const ueTextColorAttr = columnsChild?.getAttribute('data-text-color');
2121
console.log('10 textColorAttr in columns row UE: ', ueTextColorAttr);
2222

23-
if (ueBkgdColorAttr && ueBkgdColorAttr !== null && (!block.style.backgroundColor || block.style.backgroundColor == 'white')) {
23+
if (ueBkgdColorAttr && ueBkgdColorAttr !== null) {
2424
console.log('10, passing definition test: ', ueBkgdColorAttr, " passing null test: ", ueBkgdColorAttr !== null);
2525
block.style.backgroundColor = ueBkgdColorAttr;
2626
// } else {
2727
// console.log('9, failing definition test, resetting to currentBkgdColor: ', currentBkgdColor);
2828
// block.style.backgroundColor = currentBkgdColor;
2929
}
3030
console.log('10 block.style.backgroundColor: ', block.style.backgroundColor);
31-
if (ueTextColorAttr && ueTextColorAttr != null && !block.style.color) block.style.color = ueTextColorAttr;
31+
if (ueTextColorAttr && ueTextColorAttr != null) block.style.color = ueTextColorAttr;
3232

3333
const cols = [...block.firstElementChild.children];
3434
block.classList.add(`columns-${cols.length}-cols`);

0 commit comments

Comments
 (0)