Is it possible to affect child component's styling through parent component's style manager?
It might be a bit tricky but yeah, you can do it. For sure you have to create a custom Component and inside its init method (model) you would place listeners to traits/styles. Then, inside the callback method, of the listener, you'd use find method to detect child components
Read full answer below βQuestion
Hello there!
Awesome project and thanks for your contribution. I would like to know if it is possible to change the styling of a child component through it's parent's style manager.
For example, I have a block of components. The parent component contains all the other components. By clicking the parent component and going to style manager, I want to be able to change the style of the child components, either by its style properties or custom traits.
Thanks in advance.
Answers (2)
It might be a bit tricky but yeah, you can do it. For sure you have to create a custom Component and inside its init method (model) you would place listeners to traits/styles. Then, inside the callback method, of the listener, you'd use find method to detect child components
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #871
[BUG] Wrong stylemanager options first time a component/block is selected
Hello, I have noticed the following buggy behaviour on the style manager:Using a local copy of GrapesJS (ver 0.14.5) . Tested in Chrome and...
Issue #1428
[Question] Define or hide properties for specific components
Hi, I'm wondering if there is the possibility to define properties for specific components. I mean, when I select the component Image I wou...
Issue #1324
Remove attributes from a component
Hi @artf I don't know if it is possible to remove an attribute from a component. In our project I'm injecting a custom attribute from a cus...
Issue #1639
[Question]: Would it be possible to have change settings under style manager in a way that it has href when a link is created?
I'm using preset newsletter with built-in RTE (do not want to use ck editor like the demo) In order to make any text to link, i need to cli...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βRelated tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.