grapesjs
grapesjs copied to clipboard
Removing class from css when chained
Hey guys, following example of my problem: I select an element on the canvas - next to the existing class, I add a custom class in the style manager (both selected so it's chained: .class.class) - edit some styles - remove the custom class = the chained css-code stays for export (.class.class)
Editing classes independently (.class) and deleting them also deletes the class in the css-code. Is this intentioned behaviour? If not, can we do something about it?
I love this project! Thanks for all the work.
Thanks @Dari4sho I'd say the exporter is not optimizing properly
Hello @artf , Is there any update on core clear canvas command. the unused CSS are not removed. I am using latest version of grape min /*! grapesjs - 0.19.4 */ Please let me know any hook or something methods so that I can clear forcefully
Closing this as it's quite old and inactive.
Anyway removing not used CSS rules it's not always a safe option (eg. one class might be toggled dynamically via JS in the final template) but in case you're aware of that you can get the CSS with only matched rules
editor.getCss({ onlyMatched: true })