Question: Predefined background colors when selecting a element with a certain class or div.
Question
I have a question i hope sombody can help with.
I want to make a trait where i can chose predefined colors, when selecting a div with a certain div. Can anyone help me, how to achive that in a simple way?
Answers (1)
Well, you can use a simple select trait type with the list of colors and update its style once is changed. Here you can find all the examples necessary for your case: https://grapesjs.com/docs/modules/Traits.html
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2003
[Question] How to select a specific element nested inside a template
My test case: https://codepen.io/jogai/pen/QRjKyN?editors=1111 I want to select the middle column so I thought I can use selectorManager.ge...
Issue #2595
[Question] Having trouble dragging external html with draggable="true"
I want to make an external html element able to be dragged into GrapesJS, like how you can drag in a block and it will add something. I hav...
Issue #697
Question: Dropping external element into blocks
Hello, I want to drop external elements ( for example, tree view node) into blocks. Can you please help me out to show a way, how to achiev...
Issue #1111
How to add parent class when drag element
Hi @artf, Hope you are doing fine. Please let us know how we can add the parent class of div when new element is dragged inside that div li...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.