grapesjs-component-code-editor icon indicating copy to clipboard operation
grapesjs-component-code-editor copied to clipboard

Avoid removing specific selectors

Open VanShane opened this issue 3 years ago • 1 comments

Hi, I started using your plugin which was exactly what we were looking for. But my use case for grapesjs is quite specific, when I save the generated code I don't store css elements with selectors like body, *, etc..

I was wondering if there is a way to avoid removing these when deleting css in the editor, without removing the funcitonnality, I still want people to be able to write their own css and remove theirs. But I don't want them to remove the defaults.

(in red should not be removed) image

VanShane avatar Nov 04 '22 12:11 VanShane

You can make those selectors private https://github.com/artf/grapesjs-blocks-basic/blob/f7c9869e345106ad533a682fad4aafbae62264f1/src/blocks.ts#L105

Ju99ernaut avatar Jan 12 '23 16:01 Ju99ernaut