mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user