Created
March 9, 2018 10:36
-
-
Save ThomasLarge/3eb9f483f56b2320b64c57c30efdea99 to your computer and use it in GitHub Desktop.
Foundation email / Inky - Outlook background colour fix - Add bgcolor to toplevel wrappers and rows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find the file in the Node | |
node_modules/inky/lib/componentFactory.js | |
# You then need to modify the file to the below for this to work. | |
# You can also use this on other elements I have also done this on the Wrapper class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Row amends - Row line 19 | |
// Original | |
// <row> | |
case this.components.row: | |
var classes = ['row']; | |
if (element.attr('class')) { | |
classes = classes.concat(element.attr('class').split(' ')); | |
} | |
return format('<table class="%s"><tbody><tr>%s</tr></tbody></table>', classes.join(' '), inner); | |
// Amended | |
// <row> | |
case this.components.row: | |
var classes = ['row']; | |
var bgcolor = ""; | |
if (element.attr('class')) { | |
classes = classes.concat(element.attr('class').split(' ')); | |
} | |
if (element.attr('bgcolor')) { | |
bgcolor = (element.attr('bgcolor')); | |
} | |
return format('<table class="%s" bgcolor="'+bgcolor+'"><tbody><tr>%s</tr></tbody></table>', classes.join(' '), inner); | |
// Wrapper amends - Row line 155 | |
// Original | |
// <wrapper> | |
case this.components.wrapper: | |
var classes = ['wrapper']; | |
if (element.attr('class')) { | |
classes = classes.concat(element.attr('class').split(' ')); | |
} | |
return format('<table %s class="%s" align="center"><tr><td class="wrapper-inner">%s</td></tr></table>', attrs, classes.join(' '), inner); | |
// Amended | |
// <wrapper> | |
case this.components.wrapper: | |
var classes = ['wrapper']; | |
var bgcolor = ""; | |
if (element.attr('class')) { | |
classes = classes.concat(element.attr('class').split(' ')); | |
} | |
if (element.attr('bgcolor')) { | |
bgcolor = (element.attr('bgcolor')); | |
} | |
return format('<table %s class="%s" align="center" bgcolor="'+bgcolor+'"><tr><td class="wrapper-inner">%s</td></tr></table>', attrs, classes.join(' '), inner); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment