Issue #1709πŸ’¬ AnsweredOpened January 4, 2019by cmoutafidis0 reactions

Is it possible to affect child component's styling through parent component's style manager?

Quick answerby artf

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)

artfβ€’ January 6, 2019

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

lock[bot]β€’ January 6, 2020

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

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.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.