GrapesJS / mjml

Newsletter Builder with MJML components in GrapesJS
http://grapesjs.com/demo-mjml.html
BSD 3-Clause "New" or "Revised" License
637 stars 227 forks source link

font color doesn't change - style manager issues #135

Closed AliErdin closed 5 years ago

AliErdin commented 5 years ago

I can't change the font color via style manager / typography / font color

izaa commented 5 years ago

Hi, @AliErdin

just noticed same kind of issue. When changing font size or color, the new size or color is only available if i duplicate the column.

Something got just broken ..

navewi commented 5 years ago

Yeah same with line-height, align, padding, height/width and other style manager settings. Theres some big bug atm.

Clint-Chester commented 5 years ago

There's been a change in grapesjs 0.15.8 that now defaults the config.avoidInlineStyle to being true. Now if you set this back to being false, all the settings start working again. For example:

var editor = grapesjs.init({
    fromElement: true,
    container : '#gjs',
    avoidInlineStyle : false,
    plugins: ['grapesjs-mjml'],
    pluginsOpts: {
      'grapesjs-mjml': {/* ...options */}
    }
});

There is a longer term question in play though that the release notes state the support for this configuration will be dropped. @artf it seems that this configuration is required for the grapesjs-mjml plugin so what needs to be done to ensure future compatibility?

artf commented 5 years ago

Thanks @Clint-Chester for pointing out the reason. Actually is true, I'd like to remove that option because from web point-of-view is useless but in this case, not having a well-defined API for a custom renderer this option is still crucial (indeed I'll force it in the next release, it doesn't work without). Now I'll keep it in mind before removing that option completely from the code.

ps. online demo updated with the option for now.

artf commented 5 years ago

https://github.com/artf/grapesjs-mjml/releases/tag/v0.1.15

kickbk commented 4 years ago

I believe the avoidInlineStyles solution is only partial. Do this: paste this MJML to import into the canvas:

``` Button ``` Great - it works. Now click the View Code button to export. You will notice that the span around the text that had the color style is gone and an id was entered instead. This is a major problem as we use the export function to produce the MJML, and save MJML templates. Any solutions? Maybe a fix for the import/export?
Clint-Chester commented 4 years ago

I'd look at opening it up as a separate issue @kickbk as like you said it's dropping it on the import, where as the issue you commented on here was around settings not sticking when using the Style Manager.

kickbk commented 4 years ago

@Clint-Chester sorry, thought it was somehow related. Created https://github.com/artf/grapesjs-mjml/issues/147

KashafS98 commented 4 years ago

avoidInlineStyle : false,

:+1: