Custom version of 'Switch Visibility' command to change the colour of the dashed outline for specific components #4482
-
I've copied the default Switch Visibility command into my own custom command and got it all working as before. However, now I want the dashed outline for components of type 'conditional-text' to be green, but am unsure of how to achieve this. My thinking is that I can just add dashed outlines to all components as before, but at the same time get all of the 'conditional-text' components and add green dashed outlines separately using the same methodology, but I'm struggling to access the frames of the 'conditional-text' components. This is what I've done so far:
N.B. the console.log(conditionalComponent) line returns the 4 conditional components added to the canvas as expected. Any help would be massively appreciated, thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi @benryanwilliams I'm wondering if for your case using grapesjs.init({
// ...
canvasCss: `
.gjs-dashed *[data-gjs-highlightable][data-gjs-type="conditional-text"] {
outline-color: green;
}`,
}) |
Beta Was this translation helpful? Give feedback.
Hi @benryanwilliams I'm wondering if for your case using
canvasCss
might be enough