Issue #1836✓ SolvedOpened February 26, 2019by AkibDeraiya1232 reactions

How to add !important in all the generated apis

Quick answerby NicoEngler2

I may have found a solution for your problem. Please check https://github.com/artf/grapesjs/issues/1041#issuecomment-382545102

Read full answer below ↓

Question

Hello @artf, While i am going to edit some html from editor with the help of css then i need to add !important into all the css which is changed. Let me give you an example, This is previous css Now i am going to change this font's color with #000. then only this changed css need to be append with !important, So, new css will be get while i am going to fetch using editor.getCss() will be like, Can i achieve this goal?

Answers (3)

NicoEnglerFebruary 27, 2019

I don't think you need to add !important because your element with the class .banner-title gets a unique class added holding the property that has changed. So if you change the color, a new class is added with color: #your-color and thus the color defined in .banner-title is overwritten.

AkibDeraiya123February 27, 2019

@NicoEngler , Thank you for your valuable response. But thing is that i am loading one default template page with default css. In this css we have css like Now when i am changing the color to #000 using editor then the new css will be created like, But thing is that default css have already !import...

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.