Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 9b6e39d

Browse files
Merge pull request #1094 from deckgo/low-contrast
fix: low contrast warning
2 parents ccab17c + fba924d commit 9b6e39d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

studio/src/app/popovers/editor/style/app-element-style/app-element-style.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ export class AppElementStyle {
213213
<app-color-text-background
214214
key={'background'}
215215
colorType={'background'}
216+
slide={this.selectedElement.type === 'slide'}
216217
selectedElement={this.selectedElement.element}
217218
onColorChange={() => this.emitStyleChange()}></app-color-text-background>,
218219
this.renderImage(),

studio/src/app/utils/editor/node.utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class NodeUtils {
3232
}, []);
3333
}
3434

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

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

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

60-
return await this.findColors(node.parentElement, color, slide, deck);
60+
return await this.findColors(node.parentElement, color, deck, slide);
6161
}
6262
}

0 commit comments

Comments
 (0)