Issue #2263💬 AnsweredOpened September 11, 2019by benvmatheson0 reactions

Is it possible to get CSS excluding protected CSS?

快速解答by artf

Use this option editor.getCss({ avoidProtected: true })

Read full answer below ↓

Question

代码片段TEXT
I'm attempting to build this:
https://github.com/artf/grapesjs/issues/324

I've noticed that each time the CSS is saved, the protected CSS is prepended. This results in duplicate CSS rules:
`* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
*{
  box-sizing:border-box;
}
body{
  margin-top:0px;
  margin-right:0px;
  margin-bottom:0px;
  margin-left:0px;
}`

Is it possible to fetch CSS excluding protected CSS, or will I just need to remove that manually?

Answers (1)

artfSeptember 14, 2019

Use this option editor.getCss({ avoidProtected: true })

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.