feat: added block's style as a CSS class to block's root SVG (#8436)

* fix: added block's style as a CSS class to block's root SVG

* fix: added block's style as a CSS class to block's root SVG

* fix: added block's style as a CSS class to block's root SVG
This commit is contained in:
Shreshtha Sharma
2024-08-06 22:05:35 +05:30
committed by GitHub
parent f10c3b0ee8
commit 9374c028d4

View File

@@ -1178,7 +1178,10 @@ export class BlockSvg
.getRenderer()
.getConstants()
.getBlockStyle(blockStyleName);
this.styleName_ = blockStyleName;
if (this.styleName_) {
dom.removeClass(this.svgGroup_, this.styleName_);
}
if (blockStyle) {
this.hat = blockStyle.hat;
@@ -1188,6 +1191,9 @@ export class BlockSvg
this.style = blockStyle;
this.applyColour();
dom.addClass(this.svgGroup_, blockStyleName);
this.styleName_ = blockStyleName;
} else {
throw Error('Invalid style name: ' + blockStyleName);
}