Issue #1041✓ SolvedOpened Apr 13, 2018by tommedema4 reactions

Optionally insert styles from StyleManager with !important

Quick answerby tommedema2

added PR at #1056

Read full answer below ↓

Question

I'd like to suggest a feature that can be enabled through config: styleAsImportant: true (defaults to false, i.e. non-breaking). I thought this was already possible by configuring the cssComposer, though I've now learned that this is not the case (see below for an explanation). I am working with templates that sometimes were generated from pre-compilers that excessively use the !important flag. For example a button in a template might be styled as: As a result, styling this button with Grapes has absolutely no effect. The most obvious way to make it work with grapes, is to ensure that: 1) the...

Answers (3)

👍 Most helpfultommedemaApr 20, 2018

added PR at #1056

artfApr 14, 2018

It might be a good idea, but what about improving those events (eg. pass model/pr to callbacks) to allow such customizations

artfApr 19, 2018

@tommedema Components and CssRules implement Styleable, therefore you would get it in all case. do you mean that we'd have to then write plugins to listen to those events and add additional styling to the component? Not additional, you overwrite the style triggered on that model, eg.

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.