Beispiel #1
0
 public override void SetupStyles()
 {
     StyleLibraries.AddStyleLibrary("div", new Dictionary <string, string>()
     {
         { "background-color", GetAttribute("background-color") },
     });
 }
 public override void SetupStyles()
 {
     StyleLibraries.AddStyleLibrary("tableVertical", new Dictionary <string, string>()
     {
         { "margin", "0px" },
     });
 }
Beispiel #3
0
        public override void SetupStyles()
        {
            StyleLibraries.AddStyleLibrary("a", new Dictionary <string, string>()
            {
                { "display", "inline-block" },
                { "color", GetAttribute("color") },
                { "font-family", GetAttribute("font-family") },
                { "font-size", GetAttribute("font-size") },
                { "font-style", GetAttribute("font-style") },
                { "font-weight", GetAttribute("font-weight") },
                { "letter-spacing", GetAttribute("letter-spacing") },
                { "line-height", GetAttribute("line-height") },
                { "text-decoration", GetAttribute("text-decoration") },
                { "text-transform", GetAttribute("text-transform") },
                { "padding", GetAttribute("padding") },
                { "padding-top", GetAttribute("padding-top") },
                { "padding-left", GetAttribute("padding-left") },
                { "padding-right", GetAttribute("padding-right") },
                { "padding-bottom", GetAttribute("padding-bottom") }
            });

            StyleLibraries.AddStyleLibrary("td", new Dictionary <string, string>()
            {
                { "padding", GetAttribute("padding") },
                { "padding-top", GetAttribute("padding-top") },
                { "padding-left", GetAttribute("padding-left") },
                { "padding-right", GetAttribute("padding-right") },
                { "padding-bottom", GetAttribute("padding-bottom") }
            });
        }
 public override void SetupStyles()
 {
     // LR: Add styles
     StyleLibraries.AddStyleLibrary("div", new Dictionary <string, string>()
     {
         { "height", GetAttribute("height") }
     });
 }
 public override void SetupStyles()
 {
     // LR: Add styles
     StyleLibraries.AddStyleLibrary("table", new Dictionary <string, string>()
     {
         { "color", GetAttribute("color") },
         { "font-family", GetAttribute("font-family") },
         { "font-size", GetAttribute("font-size") },
         { "line-height", GetAttribute("line-height") },
         { "table-layout", GetAttribute("table-layout") },
         { "width", GetAttribute("width") },
         { "border", GetAttribute("border") },
     });
 }
Beispiel #6
0
        public override void SetupStyles()
        {
            socialAttributes = GetSocialAttributes();

            StyleLibraries.AddStyleLibrary("td", new Dictionary <string, string>()
            {
                { "padding", $"{GetAttribute("padding")}" },
                { "vertical-align", GetAttribute("vertical-align") }
            });

            StyleLibraries.AddStyleLibrary("table", new Dictionary <string, string>()
            {
                { "background-color", socialAttributes["background-color"] },
                { "border-radius", GetAttribute("border-radius") },
                { "width", socialAttributes["icon-size"] }
            });

            StyleLibraries.AddStyleLibrary("icon", new Dictionary <string, string>()
            {
                { "padding", GetAttribute("icon-padding") },
                { "font-size", "0" },
                { "height", !string.IsNullOrWhiteSpace(socialAttributes["icon-height"]) ? socialAttributes["icon-height"] : socialAttributes["icon-size"] },
                { "vertical-align", "middle" },
                { "width", socialAttributes["icon-size"] }
            });

            StyleLibraries.AddStyleLibrary("img", new Dictionary <string, string>()
            {
                { "border-radius", GetAttribute("border-radius") },
                { "display", "block" }
            });

            StyleLibraries.AddStyleLibrary("tdText", new Dictionary <string, string>()
            {
                { "vertical-align", "middle" },
                { "padding", GetAttribute("text-padding") }
            });

            StyleLibraries.AddStyleLibrary("text", new Dictionary <string, string>()
            {
                { "color", GetAttribute("color") },
                { "font-size", GetAttribute("font-size") },
                { "font-weight", GetAttribute("font-weight") },
                { "font-style", GetAttribute("font-style") },
                { "font-family", GetAttribute("font-family") },
                { "line-height", GetAttribute("line-height") },
                { "text-decoration", GetAttribute("text-decoration") },
            });
        }
Beispiel #7
0
        public override void SetupStyles()
        {
            StyleLibraries.AddStyleLibrary("div", new Dictionary <string, string>()
            {
                { "align", GetAttribute("align") },
                { "width", GetAttribute("100%") }
            });

            StyleLibraries.AddStyleLibrary("label", new Dictionary <string, string>()
            {
                { "display", "block" },
                { "cursor", "pointer" },
                { "mso-hide", "all" },
                { "-moz-user-select", "none" },
                { "user-select", "none" },
                { "color", GetAttribute("ico-color") },
                { "font-size", GetAttribute("ico-font-size") },
                { "font-family", GetAttribute("ico-font-family") },
                { "text-transform", GetAttribute("ico-text-transform") },
                { "text-decoration", GetAttribute("ico-text-decoration") },
                { "line-height", GetAttribute("ico-line-height") },
                { "padding-top", GetAttribute("ico-padding-top") },
                { "padding-right", GetAttribute("ico-padding-right") },
                { "padding-bottom", GetAttribute("ico-padding-bottom") },
                { "padding-left", GetAttribute("ico-padding-left") },
                { "padding", GetAttribute("ico-padding") }
            });

            StyleLibraries.AddStyleLibrary("trigger", new Dictionary <string, string>()
            {
                { "display", "none" },
                { "max-height", "0px" },
                { "max-width", "0px" },
                { "font-size", "0px" },
                { "overflow", "hidden" }
            });

            StyleLibraries.AddStyleLibrary("icoOpen", new Dictionary <string, string>()
            {
                { "mso-hide", "all" }
            });

            StyleLibraries.AddStyleLibrary("icoClose", new Dictionary <string, string>()
            {
                { "display", "none" },
                { "mso-hide", "all" }
            });
        }
        public override void SetupStyles()
        {
            StyleLibraries.AddStyleLibrary("table", new Dictionary <string, string>()
            {
                { "border-collapse", "separate" },
                { "width", GetAttribute("width") },
                { "line-height", "100%" },
            });

            StyleLibraries.AddStyleLibrary("td", new Dictionary <string, string>()
            {
                { "border", GetAttribute("border") },
                { "border-bottom", GetAttribute("border-bottom") },
                { "border-left", GetAttribute("border-left") },
                { "border-radius", GetAttribute("border-radius") },
                { "border-right", GetAttribute("border-right") },
                { "border-top", GetAttribute("border-top") },
                { "cursor", "auto" },
                { "font-style", GetAttribute("font-style") },
                { "height", GetAttribute("height") },
                { "mso-padding-alt", GetAttribute("inner-padding") },
                { "text-align", GetAttribute("text-align") },
                { "background", GetAttribute("background-color") },
            });

            StyleLibraries.AddStyleLibrary("content", new Dictionary <string, string>()
            {
                { "display", "inline-block" },
                { "width", CalculateAWidth(GetAttribute("width")) }, // TODO: this.calculateAWidth(this.getAttribute('width'))
                { "background", GetAttribute("background-color") },
                { "color", GetAttribute("color") },
                { "font-family", GetAttribute("font-family") },
                { "font-size", GetAttribute("font-size") },
                { "font-style", GetAttribute("font-style") },
                { "font-weight", GetAttribute("font-weight") },
                { "line-height", GetAttribute("line-height") },
                { "letter-spacing", GetAttribute("letter-spacing") },
                { "margin", "0" },
                { "text-decoration", GetAttribute("text-decoration") },
                { "text-transform", GetAttribute("tex-transform") },
                { "padding", GetAttribute("inner-padding") },
                { "mso-padding-alt", "0px" },
                { "text-align", GetAttribute("text-align") },
                { "border-radius", GetAttribute("border-radius") },
            });
        }
Beispiel #9
0
 public override void SetupStyles()
 {
     // LR: Add styles
     StyleLibraries.AddStyleLibrary("text", new Dictionary <string, string>()
     {
         { "font-family", GetAttribute("font-family") },
         { "font-size", GetAttribute("font-size") },
         { "font-style", GetAttribute("font-style") },
         { "font-weight", GetAttribute("font-weight") },
         { "letter-spacing", GetAttribute("letter-spacing") },
         { "line-height", GetAttribute("line-height") },
         { "text-align", GetAttribute("align") },
         { "text-decoration", GetAttribute("text-decoration") },
         { "text-transform", GetAttribute("text-transform") },
         { "color", GetAttribute("color") },
         { "height", GetAttribute("height") },
     });
 }
Beispiel #10
0
        public override void SetupStyles()
        {
            StyleLibraries.AddStyleLibrary("div", new Dictionary <string, string>()
            {
                { "font-size", "0" },
                { "line-height", "0" },
                { "text-align", "left" },
                { "display", "inline-block" },
                { "width", "100%" },
                { "direction", GetAttribute("direction") },
                { "vertical-align", GetAttribute("vertical-align") },
                { "background-colour", GetAttribute("background-colour") }
            });

            StyleLibraries.AddStyleLibrary("tdOutlook", new Dictionary <string, string>()
            {
                { "vertical-align", GetAttribute("vertical-align") },
                { "width", $"{GetWidthAsPixel()}" }
            });
        }
        public override void SetupStyles()
        {
            // LR: Standard Styles
            StyleLibraries.AddStyleLibrary("p", new Dictionary <string, string>()
            {
                { "border-top", $"{GetAttribute("border-style")} {GetAttribute("border-width")} {GetAttribute("border-color")}" },
                { "font-family", GetAttribute("font-family") },
                { "font-size", "1px" },
                { "margin", "0px auto" },
                { "width", GetAttribute("width") },
            });

            // LR: Outlook requires specific width
            StyleLibraries.AddStyleLibrary("outlook", new Dictionary <string, string>()
            {
                { "border-top", $"{GetAttribute("border-style")} {GetAttribute("border-width")} {GetAttribute("border-color")}" },
                { "font-family", GetAttribute("font-family") },
                { "font-size", "1px" },
                { "margin", "0px auto" },
                { "width", GetOutlookWidth() },
            });
        }
Beispiel #12
0
        public override void SetupStyles()
        {
            string width       = GetContentWidth();
            bool   isFullWidth = IsFullWidth();

            StyleLibraries.AddStyleLibrary("img", new Dictionary <string, string>()
            {
                { "border", GetAttribute("border") },
                { "border-left", GetAttribute("border-left") },
                { "border-right", GetAttribute("border-right") },
                { "border-top", GetAttribute("border-top") },
                { "border-bottom", GetAttribute("border-bottom") },
                { "border-radius", GetAttribute("border-radius") },
                { "display", "block" },
                { "outline", "none" },
                { "text-decoration", "none" },
                { "height", GetAttribute("height") },
                { "max-height", GetAttribute("max-height") },
                { "min-width", isFullWidth ? "100%" : null },
                { "width", "100%" },
                { "max-width", isFullWidth ? "100%" : null },
                { "font-size", GetAttribute("font-size") }
            });

            StyleLibraries.AddStyleLibrary("td", new Dictionary <string, string>()
            {
                { "width", isFullWidth ? null : width },
            });

            StyleLibraries.AddStyleLibrary("table", new Dictionary <string, string>()
            {
                { "min-width", isFullWidth ? "100%" : null },
                { "max-width", isFullWidth ? "100%" : null },
                { "width", isFullWidth ? width : null },
                { "border-collapse", "collapse" },
                { "border-spacing", "0px" }
            });
        }
Beispiel #13
0
        public override void SetupStyles()
        {
            var backgroundHeight = CssUnitParser.Parse(GetAttribute("background-height"));
            var backgroundWidth  = CssUnitParser.Parse(GetAttribute("background-width"));
            var backgroundRatio  = Math.Round(backgroundHeight.Value / backgroundWidth.Value * 100d);
            var width            = Element.HasAttribute("background-width") ? GetAttribute("background-width") : $"{GetContainerInnerWidth()}px";

            StyleLibraries.AddStyleLibrary("div", new Dictionary <string, string>()
            {
                { "margin", "0 auto" },
                { "max-width", $"{GetContainerInnerWidth()}px" }
            });

            StyleLibraries.AddStyleLibrary("table", new Dictionary <string, string>()
            {
                { "width", "100%" }
            });

            StyleLibraries.AddStyleLibrary("tr", new Dictionary <string, string>()
            {
                { "vertical-align", "top" }
            });

            StyleLibraries.AddStyleLibrary("td-fluid", new Dictionary <string, string>()
            {
                { "width", "0.01%" },
                { "padding-bottom", $"{backgroundRatio}%" },
                { "mso-padding-bottom-alt", "0" }
            });

            StyleLibraries.AddStyleLibrary("hero", new Dictionary <string, string>()
            {
                { "background", GetBackground() },
                { "background-position", GetAttribute("background-position") },
                { "background-repeat", "no-repeat" },
                { "padding", GetAttribute("padding") },
                { "padding-top", GetAttribute("padding-top") },
                { "padding-left", GetAttribute("padding-left") },
                { "padding-right", GetAttribute("padding-right") },
                { "padding-bottom", GetAttribute("padding-bottom") },
                { "vertical-align", GetAttribute("vertical-align") }
            });

            StyleLibraries.AddStyleLibrary("outlook-table", new Dictionary <string, string>()
            {
                { "width", $"{GetContainerInnerWidth()}px" }
            });

            StyleLibraries.AddStyleLibrary("outlook-td", new Dictionary <string, string>()
            {
                { "line-height", "0" },
                { "font-size", "0a" },
                { "mso-line-height-rule", "exactly" },
            });

            StyleLibraries.AddStyleLibrary("outlook-inner-table", new Dictionary <string, string>()
            {
                { "width", $"{GetContainerInnerWidth()}px" }
            });

            StyleLibraries.AddStyleLibrary("outlook-image", new Dictionary <string, string>()
            {
                { "border", "0" },
                { "height", GetAttribute("background-height") },
                { "mso-position-horizontal", "center" },
                { "position", "absolute" },
                { "top", "0" },
                { "width", width },
                { "z-index", "-3" }
            });

            StyleLibraries.AddStyleLibrary("outlook-inner-td", new Dictionary <string, string>()
            {
                { "background-color", GetAttribute("inner-background-color") },
                { "padding", GetAttribute("padding") },
                { "padding-top", GetAttribute("padding-top") },
                { "padding-left", GetAttribute("padding-left") },
                { "padding-right", GetAttribute("padding-right") },
                { "padding-bottom", GetAttribute("padding-bottom") },
            });

            StyleLibraries.AddStyleLibrary("inner-table", new Dictionary <string, string>()
            {
                { "width", "100%" },
                { "margin", "0px" }
            });

            StyleLibraries.AddStyleLibrary("inner-div", new Dictionary <string, string>()
            {
                { "background-color", GetAttribute("inner-background-color") },
                { "float", GetAttribute("align") },
                { "margin", "0px auto" },
                { "width", GetAttribute("width") }
            });
        }
Beispiel #14
0
        public override void SetupStyles()
        {
            bool bHasGutter = HasGutter();

            StyleLibraries.AddStyleLibrary("div", new Dictionary <string, string>()
            {
                { "font-size", "0px" },
                { "text-align", "left" },
                { "direction", GetAttribute("direction") },
                { "display", "inline-block" },
                { "vertical-align", GetAttribute("vertical-align") },
                { "width", GetMobileWidth() },
            });

            if (bHasGutter)
            {
                StyleLibraries.AddStyleLibrary("table", new Dictionary <string, string>()
                {
                    { "background-color", GetAttribute("inner-background-color") },
                    { "border", GetAttribute("inner-border") },
                    { "border-bottom", GetAttribute("inner-border-bottom") },
                    { "border-left", GetAttribute("inner-border-left") },
                    { "border-radius", GetAttribute("inner-border-radius") },
                    { "border-right", GetAttribute("inner-border-right") },
                    { "border-top", GetAttribute("inner-border-top") }
                });
            }
            else
            {
                StyleLibraries.AddStyleLibrary("table", new Dictionary <string, string>()
                {
                    { "background-color", GetAttribute("background-color") },
                    { "border", GetAttribute("border") },
                    { "border-bottom", GetAttribute("border-bottom") },
                    { "border-left", GetAttribute("border-left") },
                    { "border-radius", GetAttribute("border-radius") },
                    { "border-right", GetAttribute("border-right") },
                    { "border-top", GetAttribute("border-top") },
                    { "vertical-align", GetAttribute("vertical-align") }
                });
            }

            StyleLibraries.AddStyleLibrary("tdOutlook", new Dictionary <string, string>()
            {
                { "vertical-align", GetAttribute("vertical-align") },
                { "width", GetWidthAsPixel() }
            });

            StyleLibraries.AddStyleLibrary("gutter", new Dictionary <string, string>()
            {
                { "background-color", GetAttribute("background-color") },
                { "border", GetAttribute("border") },
                { "border-bottom", GetAttribute("border-bottom") },
                { "border-left", GetAttribute("border-left") },
                { "border-radius", GetAttribute("border-radius") },
                { "border-right", GetAttribute("border-right") },
                { "border-top", GetAttribute("border-top") },
                { "vertical-align", GetAttribute("vertical-align") },
                { "padding", GetAttribute("padding") },
                { "padding-top", GetAttribute("padding-top") },
                { "padding-right", GetAttribute("padding-right") },
                { "padding-bottom", GetAttribute("padding-bottom") },
                { "padding-left", GetAttribute("padding-left") }
            });
        }
Beispiel #15
0
        public override void SetupStyles()
        {
            bool isFullWidth = IsFullWidth();

            Dictionary <string, string> background = HasBackground() ? new Dictionary <string, string>
            {
                { "background", GetBackground() },
                // background size, repeat and position has to be seperate since yahoo does not support shorthand background css property
                { "background-position", GetBackgroundString() },
                { "background-repeat", GetAttribute("background-repeat") },
                { "background-size", GetAttribute("background-size") },
            } :
            new Dictionary <string, string>
            {
                { "background", GetAttribute("background-color") },
                { "background-color", GetAttribute("background-color") },
            };

            StyleLibraries.AddStyleLibrary("tableFullwidth",
                                           isFullWidth ? background.MergeLeft(
                                               new Dictionary <string, string> {
                { "width", "100%" },
                { "border-radius", GetAttribute("border-radius") },
            }) :
                                           new Dictionary <string, string>
            {
                { "width", "100%" },
                { "border-radius", GetAttribute("border-radius") },
            });

            StyleLibraries.AddStyleLibrary("table",
                                           !isFullWidth ? background.MergeLeft(
                                               new Dictionary <string, string> {
                { "width", "100%" },
                { "border-radius", GetAttribute("border-radius") },
            }) :
                                           new Dictionary <string, string>
            {
                { "width", "100%" },
                { "border-radius", GetAttribute("border-radius") },
            });

            StyleLibraries.AddStyleLibrary("td", new Dictionary <string, string>()
            {
                { "border", GetAttribute("border") },
                { "border-bottom", GetAttribute("border-bottom") },
                { "border-left", GetAttribute("border-left") },
                { "border-right", GetAttribute("border-right") },
                { "border-top", GetAttribute("border-top") },
                { "direction", GetAttribute("direction") },
                { "font-size", "0px" },
                { "padding", GetAttribute("padding") },
                { "padding-bottom", GetAttribute("padding-bottom") },
                { "padding-left", GetAttribute("padding-left") },
                { "padding-right", GetAttribute("padding-right") },
                { "padding-top", GetAttribute("padding-top") },
                { "text-align", GetAttribute("text-align") },
            });

            StyleLibraries.AddStyleLibrary("div",
                                           isFullWidth ? new Dictionary <string, string>
            {
                { "margin", "0px auto" },
                { "border-radius", GetAttribute("border-radius") },
                { "max-width", $"{GetContainerOuterWidth()}px" },
            } :
                                           background.MergeLeft(new Dictionary <string, string> {
                { "margin", "0px auto" },
                { "border-radius", GetAttribute("border-radius") },
                { "max-width", $"{GetContainerOuterWidth()}px" }
            }));

            StyleLibraries.AddStyleLibrary("innerDiv", new Dictionary <string, string>()
            {
                { "line-height", "0" },
                { "font-size", "0" }
            });
        }