Deleting default styles does not work
Hi there! have you tried using setStyle ? cheers.
Read full answer below ↓Question
Hello, i'm trying to delete some of the default styles of the blocks. I wrote everything I changed in a plugin. I used this function to update for example the Text Components style-defaults: editor.DomComponents.addType(.....) seen here: https://grapesjs.com/docs/modules/Components.html#update-component-type Am I getting this wrong? Also I can't figure out where the style defaults are written, when I change the style-defaults in Text.js for testing, nothing changes in the editor. Oh and i'm using the mjml-plugin, maybe this issue is wrong here sorry. Edit: Okay i figured out "style" works but...
Answers (3)
Hi there! have you tried using setStyle ? cheers.
I'd expect something like this to work (update style-default)
editor.DomComponents.addType('mj-text', {
model: {
defaults: {
'style-default': {
// your new styles...
}
}
}
})
Be sure to load your plugin after the mjml one
Hello @artf, thanks for your reply. this is the exact same code, that i tried out. This one works if I use "style" instead of "style-default".
Related Questions and Answers
Continue research with similar issue discussions.
Issue #4083
Set root does not work
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Safari 15.0Reproducible demo link https://js...
Issue #3225
How to Update Style from checkbox Trait?
Hi @artf I am trying to update the style using the checkbox trait but it's not calling the function. Here is the code I really appreciate a...
Issue #2920
Question: Replace Rich Text Editor with summernote does not seem to work
I am trying to replace the default RTE in grapesjs with summernote. I got some help from the author of summernote and got this codepen to w...
Issue #3174
Creating a new component type does not inherit the functions of it's parent type
Hello, I am trying to create a new common trait shared among all components by creating the following plugin on another plugin file I am al...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →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.