fix: theme types (#6423)

* chore: fix theme types

* chore: format
This commit is contained in:
Beka Westberg
2022-09-26 12:52:46 -07:00
committed by GitHub
parent f2e408b6fa
commit abad51fdb0
8 changed files with 78 additions and 38 deletions

View File

@@ -216,15 +216,19 @@ export class FieldTextInput extends Field {
* @internal
*/
override applyColour() {
if (this.sourceBlock_ && this.getConstants()!.FULL_BLOCK_FIELDS) {
if (this.borderRect_) {
this.borderRect_.setAttribute(
'stroke', (this.sourceBlock_ as BlockSvg).style.colourTertiary);
} else {
(this.sourceBlock_ as BlockSvg)
.pathObject.svgPath.setAttribute(
'fill', this.getConstants()!.FIELD_BORDER_RECT_COLOUR);
if (!this.sourceBlock_ || !this.getConstants()!.FULL_BLOCK_FIELDS) return;
const source = this.sourceBlock_ as BlockSvg;
if (this.borderRect_) {
if (!source.style.colourTertiary) {
throw new Error(
'The renderer did not properly initialize the block style');
}
this.borderRect_.setAttribute('stroke', source.style.colourTertiary);
} else {
source.pathObject.svgPath.setAttribute(
'fill', this.getConstants()!.FIELD_BORDER_RECT_COLOUR);
}
}