Correctly import mjml with composed attributes #197
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If currently a composed attribute such as "padding: 10px 20px 30px 40px" is contained in an imported template, the default values are loaded and the value from the template is ignored.
This is caused by the "style-default" attribute containing "padding-left", "padding-right", "padding-top" and "padding-bottom" for many components. These default attributes are merged with the values of the imported templates. The more specific "padding-top/bottom/left/right" attributes containing the default values will have precedence over the "padding" attribute from the template.
To reproduce the error import the following code with the latest revision of grapes-mjml and the default padding will be set for the section instead of 100px.
Now in comparison import the following mjml which displays with a padding of 100px.
If you compile both examples with the mjml compiler or at https://mjml.io/try-it-live/, both will have a padding of 100px.