Issue #1978💬 AnsweredOpened April 25, 2019by 3dmedium0 reactions

Styles allways applied to classes

Quick answerby artf

Can you please try to add this to your options avoidInlineStyle: true and let me know

Read full answer below ↓

Question

Hello, I have a Problem with styling individual Items. The following html Code: Loads fine. But when I Click the Component with "#icbp" then the class .ddm-flex-cols-element will get the style max-width. Setting this.el.style while rendering the Object is also Integrated to the CSS (Id only) the Docs tell changes to this.el will not being saved to Components. Reproduction with DEMO is not possible for me because its only happening with some loaded canvas styles. I'm using version 0.14.57 My Config for reproduction:

Answers (3)

artfMay 1, 2019

Can you please try to add this to your options avoidInlineStyle: true and let me know

3dmediumMay 1, 2019

Hi @artf , Yes I tried this, still no luck. I had the time to minimize this issue to a codesandbox: https://codesandbox.io/embed/jnplq7op55 Position of the protectedCss Content can be varied put it to style or in a file and load it by cvanvas.style the behavior keeps the same. The Issue is gone by...

artfMay 1, 2019

Ok, the problem happens here: https://github.com/artf/grapesjs/blob/e97afb429b4cada591e119025fcf34490cb0de8c/src/style_manager/index.js#L284-L285 if there is no CSS rule with the selector found on the component (in our case ddm-flex-cols-element) the rule is created and all its styles are moved to...

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.