I'm trying to figure out how to modify the CSS when a WebPart is added.
The Idea is to span the background of the added Web Part across all columns, let's say the Web Part is added in the left column on a 2 column page. The background would span across all the CanvasZone row. Not just the column where the Web Part is added.
UPDATE:
Here is my code in the render method. I'm working with the HelloWebPart to have something really simple
public render(): void {
this.domElement.innerHTML = `
<div class="${ styles.helloWorld }">
<div class="${ styles.container }">
<div class="${ styles.row }">
<div class="${ styles.column }">
<span class="${ styles.title }">Welcome to SharePoint!</span>
<p class="${ styles.subTitle }">Customize SharePoint experiences using Web Parts.</p>
<p class="${ styles.description }">${escape(this.properties.description)}</p>
<a href="https://aka.ms/spfx" class="${ styles.button }">
<span class="${ styles.label }">Learn some more</span>
</a>
</div>
</div>
</div>
</div>`;
jQuery(function(){
jQuery('.helloWorld_385074c7').closest('div.CanvasZone').css({
'background-color': 'green'
});
});
}