Issue #672💬 AnsweredOpened December 22, 2017by mingodad2 reactions

Missing option to erase style options

快速解答by artf1

Hi @mingodad there is actually an option which enables the possibility to clear values but it's still a work in progress (have to deal better with composite types)

Read full answer below ↓

Question

Hello ! In several style options there is no way to erase/reset several options like:

  • font-family : if we select a font to experiment and decided that we do not want any custom there is no way to reset it.
  • dimensions-width: if we experiment with some value and do not want any custom value we can erase the value but we still get a style in the css "width:auto" that in some cases mess up the layout (could we have the property removed completely ?).

The same apply to several other properties we need a default options in all of then to be able to remove/erase then from the generated styles.

Cheers !

Answers (3)

artfDecember 27, 2017

Hi @mingodad there is actually an option which enables the possibility to clear values but it's still a work in progress (have to deal better with composite types)

grapesjs.init({
	...
	styleManager: {
		clearProperties: true,
		...
	}
})
artfAugust 26, 2019

@benvmatheson

const sm = editor.StyleManager;
sm.getConfig().clearProperties = 1;
sm.render();
afoteyDecember 22, 2017

A SCSS style tutorial would be nice

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.