Issue #383šŸ’¬ AnsweredOpened October 5, 2017by daniel-farina1 reactions

Best way to load element's css into the properties panel.

Quick answerby daniel-farinaā¤ 1

@artf I undertand now I completely missed the checkbox next to each selector. Setting the forceClass to false solves all my problems! I dont really need that as I'm keeping the source code extremely lean with as little divs as possible. Thank you very much for that! Dan

Read full answer below ↓

Question

Hi Again everyone, GrapeJS is too much fun once you get deep into it. I have a simple question: What's the best way to load the css from a newly created element to the properties panel. For example I have the following box which has a black background: The black background comes from the style in the element The editor converts the style tag into a class as shown here: yet the properties panel does not have a background set: Now I change the color to dark orange: it will create a new class for it that will overwrite the previous one: Thank you in advanced for any thoughts!

Answers (3)

daniel-farina• October 6, 2017

@artf I undertand now I completely missed the checkbox next to each selector. Setting the forceClass to false solves all my problems! I dont really need that as I'm keeping the source code extremely lean with as little divs as possible. Thank you very much for that! Dan

daniel-farina• October 5, 2017

I discovered that if the div has no class and just style then a single class is created and the background is applied to the properties panel: so that would be a partial solution for now but still looking for a better alternative.

artf• October 5, 2017

Hi @daniel-farina you don't see .c1019's background because your component has two classes so, by default, the Style Manager select the CSS rule where the selector is a combination of all its classes, in your case .col-8.c1019. If you want to see .c1019's styles you can just deselect .col-8 You can...

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.