Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ export class AppElementStyle {
<app-color-text-background
key={'background'}
colorType={'background'}
slide={this.selectedElement.type === 'slide'}
selectedElement={this.selectedElement.element}
onColorChange={() => this.emitStyleChange()}></app-color-text-background>,
this.renderImage(),
Expand Down
8 changes: 4 additions & 4 deletions studio/src/app/utils/editor/node.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class NodeUtils {
}, []);
}

static async findColors(node: HTMLElement, color: 'color' | 'background', slide: HTMLElement, deck: HTMLElement): Promise<string | undefined> {
static async findColors(node: HTMLElement, color: 'color' | 'background', deck: HTMLElement, slide: HTMLElement): Promise<string | undefined> {
// Just in case
if (node.nodeName.toUpperCase() === 'HTML' || node.nodeName.toUpperCase() === 'BODY') {
return undefined;
Expand All @@ -46,8 +46,8 @@ export class NodeUtils {
return deck.style.getPropertyValue(`--${color}`);
}

if (node.isEqualNode(slide) && slide.style[color] !== '') {
return slide.style[color];
if (node.isEqualNode(slide) && (slide.style.getPropertyValue(`--${color}`) !== '' || slide.style[color] !== '')) {
return slide.style.getPropertyValue(`--${color}`) !== '' ? slide.style.getPropertyValue(`--${color}`) : slide.style[color];
}

const styleAttr: string = color === 'background' ? 'background-color' : 'color';
Expand All @@ -57,6 +57,6 @@ export class NodeUtils {
return node.style[styleAttr];
}

return await this.findColors(node.parentElement, color, slide, deck);
return await this.findColors(node.parentElement, color, deck, slide);
}
}