Ju99ernaut / grapesjs-component-code-editor

Code editor for grapesjs
MIT License
64 stars 21 forks source link

Avoid removing specific selectors #44

Open VanShane opened 1 year ago

VanShane commented 1 year ago

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

Ju99ernaut commented 1 year ago

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