Closed pittleCheung closed 1 year ago
Extended idea from https://github.com/GrapesJS/grapesjs/issues/1855
Here it's explained how to create components with related styles https://grapesjs.com/docs/modules/Components.html#components-css
Only in that case, it would be safe for the editor to delete related styles.
GrapesJS version
What browser are you using?
latest version of Chrome
Reproducible demo link
https://grapesjs.com/demo.html
Describe the bug
How to reproduce the bug?
What is the expected behavior? it's style maybe reduce,
What is the current behavior? First of all, my editor only uses one page. Every time I switch pages, it will replace the current configuration with a page from the backend. Therefore, when I implement the public header and tail, I can use editor.CodeManager.getCode(component , 'html', {cssc: editor.CssComposer}); to replace the component, but I cannot use editor.CodeManager.getCode(component, 'css', {cssc: editor.CssComposer}) to replace the style, which will cause if If I operate (delete and add components) the components inside the head and tail multiple times, a lot of redundant styles will appear.
If is necessary to execute some code in order to reproduce the bug, paste it here below:
Code of Conduct