Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatem, mollitia, vero tempore consectetur similique perspiciatis nisi nulla neque modi facilis. Eveniet, cupiditate, recusandae quasi repellat alias dolorem qui possimus et.
68 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Omnis, doloremque, amet, cupiditate explicabo magni dolores aliquam dicta enim voluptatibus hic optio neque quasi officia culpa minima numquam iusto illo dolorem?
We test and support all the major email clients … even Outlook.
3 |
4 |
We support as many email clients and as much of the market as possible, however, we simply can't test for everything. As a result, we've decided to test the following clients, based on a combination of their market share and our ability to reliably test them with the devices and software we have access to.
5 |
While we will help out as much as possible with issues regarding other clients (and are more than willing to accept pull requests that add support for additional clients), we can't devote a lot of time or effort at this point to fixing issues related to email clients not in the following table.
6 |
Tested Clients
7 |
8 |
9 |
10 |
Client
11 |
Supported
12 |
Notes
13 |
14 |
15 |
16 |
17 |
Apple Mail (Desktop)
18 |
✔
19 |
20 |
21 |
22 |
Apple Mail (iOS)
23 |
✔
24 |
25 |
26 |
27 |
Outlook (2000, 2002, 2003)
28 |
✔
29 |
30 |
31 |
32 |
Outlook (2007, 2010, 2013)
33 |
✔
34 |
35 |
36 |
37 |
Outlook (2011)
38 |
✔
39 |
40 |
41 |
42 |
Thunderbird
43 |
✔
44 |
45 |
46 |
47 |
Android
48 |
✔
49 |
50 |
51 |
52 |
Gmail (Desktop)
53 |
✔
54 |
55 |
56 |
57 |
Gmail (Mobile, iOS, Android)
58 |
✔
59 |
Does not fully support the Ink grid. Responsive layouts should be accomplished using the block-grid.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore eius repellendus voluptates nisi vitae nulla similique provident expedita. Fuga, magni, iusto vel a aperiam nihil expedita voluptas odio hic odit!
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
Full Width Row
77 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore eius repellendus voluptates nisi vitae nulla similique provident expedita. Fuga, magni, iusto vel a aperiam nihil expedita voluptas odio hic odit!
49 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto, recusandae natus temporibus quas at ea doloremque illo. Explicabo, accusantium, eius. Nihil quia dignissimos minus nisi similique sapiente culpa totam molestiae.
50 |
51 |
52 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto, recusandae natus temporibus quas at ea doloremque illo. Explicabo, accusantium, eius. Nihil quia dignissimos minus nisi similique sapiente culpa totam molestiae.
53 |
54 |
55 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto, recusandae natus temporibus quas at ea doloremque illo. Explicabo, accusantium, eius. Nihil quia dignissimos minus nisi similique sapiente culpa totam molestiae.
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
Panel content
69 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto, recusandae natus temporibus quas at ea doloremque illo.
70 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor, adipisci eveniet distinctio vero doloremque repellendus dolores ex veritatis ipsum maiores quis non reprehenderit expedita cumque esse repudiandae alias aperiam earum.
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
No .text-pad
59 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor, adipisci eveniet distinct vero doloremque repellendus dolores ex veritatis ipsum maiores quis non reprehenderit expedita cumque esse repudiandae alias aperiam earum.
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
.left-text-pad
77 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor, adipisci eveniet distinctio vero doloremque repellendus dolores ex veritatis ipsum maiores quis non reprehenderit expedita cumque esse repudiandae alias aperiam earum.
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
.right-text-pad
90 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor, adipisci eveniet distinctio vero doloremque repellendus dolores ex veritatis ipsum maiores quis non reprehenderit expedita cumque esse repudiandae alias aperiam earum.
6 | Starting a new Ink project is fairly straightforward. If you aren’t using one of our templates, grab the boilerplate code from below to use as a starting point. While you can reference ink.css using a <link> tag for testing purposes, be sure to remove the <link rel="stylesheet" href="ink.css" /> statement and paste your CSS into the <style> tag in the head before running your email through an inliner.
7 |
46 | If you’re applying a background color to your entire email, be sure to attach it to the table with a class of body as well as to the actual <body> tag, since some clients remove this by default.
47 |
48 |
Inline Styles
49 |
51 |
52 | ...
53 |
54 |
55 |
56 |
57 | ...
58 |
59 |
60 | '
61 | , 'html'); ?>
62 |
63 |
CSS
64 |
69 |
70 |
71 |
Sending Your Email
72 |
Sending HTML email is a lot different than sending plain text email. While it may be tempting to just open the email in a browser and click “share” or to use the “Insert HTML” function of your favorite email client, this often strips off a lot of the styling and makes your email completely unusable on mobile devices.
73 |
To get the best results, we recommend that you send your HTML email using an Email Service Provider (ESP) such as Mailchimp or Campaign Monitor. If you’re just running a quick test and don't want to sign up for an ESP, sending from the command line using a scripting language like PHP or Ruby usually works fine.
74 |
75 |
Testing and Troubleshooting
76 |
Since targeting a diverse range of email clients requires some specific and rather quirky markup, Ink doesn’t always preview properly in the browser. When doing browser tests, we recommend using the latest version of Chrome, Safari or Opera, since Ink doesn’t always display properly in Firefox or Internet Explorer.
77 |
Testing in the browser isn't enough, however, and you should always test in actual email clients. If you don't have access to the actual clients you want to test, a testing service like Litmus or Email on Acid can help.
78 |
If you're having trouble with an email, the first thing to check is the markup. Often times a simple error like a forgotten <tr> or a nested tag that’s been closed in the wrong order can wreak havoc on your design. If that’s not the problem, it could be an issue with your ESP. Some senders prepend an <html> tag to your message, which causes the DOCTYPE tag to not be interpreted by the email recipient. To see if this is what’s happening, try sending a test email to yourself and using the “show original” or “raw source” option in your mail client to manually inspect the code.
A non-stacking grid for even more versatile layouts.
3 |
4 |
5 |
Grids Within Grids
6 |
While the Ink grid can't be nested like its Foundation counterpart, Ink does provide a nestable sub-grid for when one grid just isn't enough. By applying a .sub-columns class (as well as a numbered class, same as the primary grid) to a <td> tag underneath a .columns table, you can sub-divide the .columns table into sub-columns.
7 |
The last .sub-columns<td> in the .columns<table> should be given a class of last in order for the gutter padding to be properly maintained.
8 |
Basic Sub-Grid Example
9 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | .eight.sub-columns
19 |
20 |
21 |
22 |
23 | .four.sub-columns
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | .four columns
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | ',
47 | 'html') ?>
48 |
49 |
Non-Collapsing Sub-Grid Columns
50 |
51 |
52 |
53 |
Compatibility
54 |
55 |
56 |
57 |
The sub-grid works as expected in most major email clients.
Selectively show content for different screen sizes.
3 |
4 |
5 |
By adding a visibility class to an element, you can show or hide it based on screen size. Visibility classes can be used on any element. Due to Outlook's lack of support for certain CSS properties, the Ink visibiility classes should be used in conjunction with conditional comments to ensure that the content is properly hidden (or shown) in Outlook 2007/2010/2013.
6 |
Note: If you're using a visibility class on an image, be sure to apply it to the parent element, not to the image itself.
7 |
Using Visibility Classes
8 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | .show-for-small
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | .hide-for-small
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | ',
40 | 'html') ?>
41 |
42 |
Content Visibility
43 |
44 |
45 |
46 |
Breakdown
47 |
Available visibility classes:
48 |
49 |
50 |
.hide-for-small
51 |
52 |
53 |
.show-for-small
54 |
55 |
56 |
57 |
58 |
Compatibility
59 |
60 |
61 |
62 |
Visibility classes work as expected in most major email clients, but do not currently support Gmail.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Sassy Ink
2 |
3 | > The *unofficial* Sass port of [Ink](http://zurb.com/ink), Zurb's responsive email framework. If you are going to build a responsive HTML email, treat yourself to the most customizable version of the leading framework, Sassy Ink.
4 |
5 | Please let me know if you use Sassy Ink.
6 |
7 | ## Why use Sassy Ink?
8 |
9 | 1. Zurb's Ink is the leading responsive email framework. Sassy Ink provides 80 or so customizable variables. You can have it your way.
10 | 1. It makes clients happy. Clients never want framework defaults. Sassy Ink makes it easy to customize container width, number of columns, gutter width, break point, colors, font sizes, font-families, margins, padding, etc...
11 | 1. Pretty closely follows [Foundation](http://foundation.zurb.com/)'s Sass structure and naming conventions. If you are familiar with Foundation (or even Bootstrap), you are familiar with Sassy Ink.
12 | 1. You can easily verify that you are getting all the benefits of Ink because the generated CSS is as close to Zurb's original `ink.css` as possible. If you don't touch the default variables, the differences are trivial.
13 |
14 | It is a great start for a simple Sass port.
15 |
16 | ## Contributing
17 |
18 | There is much left to do, so please feel free to pitch in.
19 |
20 |
21 | ## _settings.scss
22 |
23 | You will want to make changes to the settings file which includes 80 or so variables that can be customized for each component. Making changes is simple, in `_settings.scss` find the element you want to style. Find the variable, uncomment the style, and change its value. Be sure to compile Sass stylesheets to CSS in order see any changes.
24 |
25 | ## Runtime Dependencies
26 |
27 | Per the `Gemfile`:
28 |
29 | **sass** <= 3.3.13 & >= 3.2.5
30 |
31 | As of this writing, Sassy Ink is still compatible with [Compass](http://compass-style.org/) versions 0.12.2 through 1.0.1 (as long Sass is between version 3.2.5 and 3.3.13), [Koala](http://koala-app.com/) 2.0.3, and [CodeKit](https://incident57.com/codekit/) 2.1.3. It also appears to be compatible with [Scout](http://mhs.github.io/scout-app/) 0.7.1, even though Scout looks like it's using Sass 3.2.1. I haven't tested any others. Please let me know if you do.
32 |
33 | It is **not** *necessarily* compatible with Sass >= 3.4 because assigning to global variables by default is deprecated. Using `!global` to fix this is incompatible with Sass < 3.3 and would break current versions of Koala and Scout; most versions of Compass less than 1.0.1 (August 18, 2014); and probably several other Sass compilers. Fortunately, the incompatibility is limited to the `export` mixin, which is used to prevent styles from being loaded multiple times for components that rely on other components. So, unless you are doing customization beyond setting variables in `_settings.scss`, this is not likely to be a problem. Yet, it seems worth mentioning.
34 |
35 | ## Precision
36 |
37 | In order to have the same number of significant digits as in the original Zurb `ink.css`, you must set the precision to 6. For example:
38 |
39 | sass --precision 6 scss/ink.scss css/ink.css
40 |
41 | In the Compass `config.rb`:
42 |
43 | Sass::Script::Number.precision = 6
44 |
45 | In `Gruntfile.js`:
46 |
47 | grunt.initConfig({
48 | sass: {
49 | dist: {
50 | options: {
51 | precision: 6
52 | },
53 | files: {
54 | 'css/ink.css': 'scss/ink.scss'
55 | }
56 | }
57 | }
58 | });
59 | grunt.loadNpmTasks('grunt-contrib-sass');
60 |
61 | ## Testing
62 |
63 | The only testing I am doing so far is comparing the Saas generated `ink.css` with a slightly massaged Zurb's [`ink.css` version 1.0.5.](https://github.com/zurb/ink/blob/416e0666bfe54a5c9f5dbeaa4c26d29b95b80c0c/css/ink.css) Please note Zurb's [`ink.css` on GitHub](https://github.com/zurb/ink/blob/master/css/ink.css) does not necessarly match the [version distributed on their website](http://zurb.com/ink/).
64 |
65 | ### Massaging
66 |
67 | 1. Run the CSS file through a Sass compiler to clean up some white space issues (`sass --precision 6 --style expanded test/fixtures/ink.css test/results/target.css`)
68 | 1. Remove an annoying line-break difference (`s/(table\[class="body"\] td\.offset\-by\-)(\w+)\s*?(,?\s*)(?=\1\w+)/$1$2, /g`)
69 | 1. Rename filename for the sourceMappingURL, should one exist, from 'target' to 'ink'.
70 |
71 | ### Diff
72 |
73 | `diff -bBs test/results/target.css test/results/ink.css`
74 |
75 | Files test/results/target.css and test/results/ink.css are identical
76 |
77 | ## To Do
78 |
79 | * I haven't yet figured out what to do with the docs, `CONTRIBUTING.md`, `Gruntfile.js`, `bower.json`, etc...
80 |
81 | ## Credit
82 |
83 | * [ZURB](http://www.zurb.com) (obvious)
84 | * [René Meye](https://github.com/renemeye)'s [pull request #61](https://github.com/zurb/ink/pull/61). (less obvious)
85 |
86 | ### Ink
87 |
88 |
89 | Ink is a responsive email framework, used to make HTML emails look great on any client or device. It includes a 12-column grid, as well as some simple UI elements for rapid prototyping.
90 |
91 | Homepage: http://zurb.com/ink
92 | Documentation: http://zurb.com/ink/docs.php
93 | Download: http://zurb.com/ink/download.php
94 |
95 | Ink was made by [ZURB](http://www.zurb.com), is MIT-licensed, and absolutely free to use.
--------------------------------------------------------------------------------
/scss/ink/_settings.scss:
--------------------------------------------------------------------------------
1 | // Ink by ZURB
2 | // zurb.com/ink/
3 | // Licensed under MIT Open Source
4 |
5 | //
6 | // INK SETTINGS
7 | //
8 |
9 | // Allows the use of rem-calc() or lower-bound() in your settings
10 | @import "functions";
11 |
12 | // $base-line-height: 1.3;
13 |
14 | // We use this to control whether or not CSS classes come through in the gem files.
15 | // $include-html-classes: true;
16 |
17 |
18 |
19 | //
20 | // $GLOBAL
21 | //
22 |
23 | // $include-hyphens : false;
24 | // $include-html-global-classes: $include-html-classes;
25 |
26 | // We use these to control font styles
27 | // $base-font-color: #222222;
28 | // $base-font-family: Helvetica, Arial, sans-serif;
29 | // $base-font-weight: normal;
30 |
31 | // $body-font-size: 14px;
32 | // $body-line-height: 19px;
33 |
34 | // We use these as default colors throughout
35 | // $primary-color: #2795b6;
36 | // $secondary-color: #e9e9e9;
37 | // $alert-color: #c60f13;
38 | // $success-color: #5da423;
39 |
40 | // We use this to control how much we darken things on hover
41 | // $secondary-border-color: #d0d0d0;
42 | // $alert-border-color: #457a1a;
43 | // $success-border-color: #970b0e;
44 |
45 | // We use these to make sure border radius matches unless we want it different.
46 | // $global-radius: 3px;
47 | // $global-rounded: 500px;
48 |
49 | // $column-gutter: 20px;
50 |
51 |
52 |
53 | //
54 | // $NORMALIZE
55 | //
56 |
57 | // $include-html-normalize-classes: $include-html-classes;
58 |
59 |
60 |
61 | //
62 | // $ALIGNMENT
63 | //
64 |
65 | // $include-html-alignment-classes: $include-html-classes;
66 |
67 |
68 |
69 | //
70 | // $GRID
71 | //
72 |
73 | // $include-html-grid-classes: $include-html-classes;
74 | // $include-html-sub-colums-grid-classes: $include-html-grid-classes;
75 |
76 | // $container-width: 580px;
77 | // $small-container-width: 95%;
78 | // $total-columns: 12;
79 |
80 | // $wrapper-padding-top: 10px;
81 | // $column-cell-padding-bottom: 10px;
82 | // $text-padding: 10px;
83 |
84 | // $sub-column-padding-right: $column-gutter / 2;
85 |
86 |
87 |
88 | //
89 | // $MEDIA-QUERY-RANGES
90 | //
91 |
92 | // $include-html-media-query-classes: $include-html-classes;
93 |
94 | // $small-range: (0px, $container-width * (600px / 580px));
95 |
96 | // $screen: "only screen";
97 |
98 | // $landscape: "#{$screen} and (orientation: landscape)";
99 | // $portrait: "#{$screen} and (orientation: portrait)";
100 |
101 | // $small-up: $screen;
102 | // $small-only: "#{$screen} and (max-width: #{upper-bound($small-range)})";
103 |
104 |
105 |
106 | //
107 | // $OUTLOOK-FIRST
108 | //
109 |
110 | // $include-html-outlook-first-classes: $include-html-classes;
111 |
112 |
113 |
114 | //
115 | // $TYPOGRAPHY
116 | //
117 |
118 | // $include-html-type-classes: $include-html-classes;
119 |
120 | // We use these to control header font sizes
121 | // $h1-font-size: 40px;
122 | // $h2-font-size: 36px;
123 | // $h3-font-size: 32px;
124 | // $h4-font-size: 28px;
125 | // $h5-font-size: 24px;
126 | // $h6-font-size: 20px;
127 |
128 | // A general styling
129 | // $small-font-size: 10px;
130 |
131 | // We use these to style lead paragraphs
132 | // $paragraph-margin-bottom: 10px;
133 | // $paragraph-lead-font-size: 18px;
134 | // $paragraph-lead-line-height: 21px;
135 |
136 | // We use these to style anchors
137 | // $anchor-text-decoration: none;
138 | // $anchor-font-color: #2ba6cb;
139 | // $anchor-font-color-visited: $anchor-font-color;
140 | // $anchor-font-color-hover: #2795b6;
141 | // $anchor-font-color-active: $anchor-font-color-hover;
142 |
143 | // $header-anchor-font-color: $anchor-font-color;
144 | // $header-anchor-font-color-visited: $header-anchor-font-color;
145 | // $header-anchor-font-color-active: $header-anchor-font-color;
146 |
147 | // We use these to style the element
148 | // $hr-color: #d9d9d9;
149 | // $hr-height: 1px;
150 |
151 |
152 |
153 | //
154 | // $BLOCK-GRID
155 | //
156 |
157 | // $include-html-block-grid-classes: $include-html-grid-classes;
158 |
159 | // We use this to control the maximum number of block grid elements per row
160 | // $block-grid-elements: 8;
161 | // $block-grid-default-spacing: $column-gutter;
162 | // $align-block-grid-to-grid: false;
163 |
164 |
165 |
166 | //
167 | // $BUTTONS
168 | //
169 |
170 | // $include-html-button-classes: $include-html-classes;
171 |
172 | // We use these to build padding for buttons.
173 | // $button-dft: 8px 0;
174 | // $button-tny: 5px 0;
175 | // $button-sml: 8px 0;
176 | // $button-med: 12px 0;
177 | // $button-lrg: 21px 0;
178 |
179 | // We use these to control button text styles.
180 | // $button-font-family: $base-font-family;
181 | // $button-font-color: #ffffff;
182 | // $button-font-color-alt: #555555;
183 | // $button-font-tny: 12px;
184 | // $button-font-sml: 16px;
185 | // $button-font-med: 20px;
186 | // $button-font-lrg: 24px;
187 |
188 | // We use these to control button border styles.
189 | // $button-border-width: 1px;
190 | // $button-border-style: solid;
191 | // $button-bg: #2ba6cb;
192 | // $button-border-color: #2284a1;
193 |
194 | // We use this to set the default radius used throughout the core.
195 | // $button-radius: $global-radius;
196 | // $button-round: $global-rounded;
197 |
198 |
199 |
200 | //
201 | // $PANELS
202 | //
203 |
204 | // $include-html-panel-classes: $include-html-classes;
205 |
206 | // We use these to control the background and border styles
207 | // $panel-bg: #f2f2f2;
208 | // $panel-border-style: solid;
209 | // $panel-border-size: 1px;
210 |
211 | // We use this to control how much we darken things on hover
212 | // $panel-border-color: #d9d9d9;
213 |
214 | // We use this to set default padding
215 | // $panel-padding: 10px;
--------------------------------------------------------------------------------
/docs/components/buttons.php:
--------------------------------------------------------------------------------
1 |
Buttons
2 |
Dynamic and effective calls to action.
3 |
4 |
Structure
5 |
To create buttons that look great in most clients, make a table of class button to wrap your <a> tag. Buttons expand to the full width of their container by default, so if you don't want them to expand all the way, consider placing them in a sub-grid or block-grid element.
Several built in styling classes can be applied to the same element as the button class is applied to in order to adjust the button's appearance.
20 |
Size
21 |
Size classes affect the button's vertical padding. The available size classes are:
22 |
23 |
24 |
.button (same as .small-button)
25 |
26 |
27 |
.tiny-button
28 |
29 |
30 |
.small-button
31 |
32 |
33 |
.medium-button
34 |
35 |
36 |
.large-button
37 |
38 |
39 |
Color
40 |
Color classes denote the purpose of the button, and are used to change its background color. The available color classes are:
41 |
42 |
43 |
none (same as .primary)
44 |
45 |
46 |
.primary
47 |
48 |
49 |
.secondary
50 |
51 |
52 |
.alert
53 |
54 |
55 |
.success
56 |
57 |
58 |
Border Radius
59 |
Radius classes cause the corners of the buttons to be rounded in clients that support the border-radius property. The available radius classes are:
60 |
61 |
62 |
none (no border-radius)
63 |
64 |
65 |
.radius
66 |
67 |
68 |
.round
69 |
70 |
71 |
72 |
Examples
73 |
Buttons expand to the width of their parent container by default, so it's recommended that you contain them within a sub-grid or a relatively small number of columns on the main grid.
74 |
Button Demo
75 |
All the button modifiers demonstrated. The rows of buttons are contained to .four.columns or .six.columns sections of the grid for clarity.
76 |
77 |
78 |
79 |
Compatibility
80 |
81 |
82 |
83 |
The buttons are compatible with most major clients.
Add a class of panel to a <td> in a .columns table in order to give it a default border and background color. Great for offsetting important content or for quickly prototyping a layout.
6 |
Panel Markup
7 |
9 |
10 |
11 |
12 | Panel content
13 |
14 |
15 |
16 |
17 | ',
18 | 'html') ?>
19 |
20 |
Panel Example
21 |
22 |
23 |
24 |
Examples
25 |
Sidebar Panel
26 |
A common patten is to have a panel section serve as a sidebar to offset it from the primary content.
27 |
Sidebar Panel Markup
28 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | Main content
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | Panel content
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | ',
61 | 'html') ?>
62 |
63 |
Sidebar Panel
64 |
65 |
66 |
67 |
Panels With Sub-grids
68 |
Nesting a sub-grid under a panel is non-intuitive, since the sub-grid columns would normally be applied to the <td> elements directly under the .columns table. To get around this, give the <td> a class of .panel and a class of .sub-grid. You can then put a <table> inside the <td> and create the sub-columns using the <td> elements of the inner table, as shown below.
69 |
Panel Sub-Grid Markup
70 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 | Left Sub-Column
80 |
81 |
82 |
83 |
84 | Right Sub-Column
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 | ',
94 | 'html') ?>
95 |
96 |
Sub-Grid Panel
97 |
98 |
99 |
100 |
Compatibility
101 |
102 |
103 |
104 |
Panels work as expected in most major email clients.
An even-width element grid that doesn't use media queries.
3 |
4 |
Evenly Spaced Blocks
5 |
For cases where neither the Ink grid nor the Ink sub-grid is appropriate, the block-grid can often be quite useful. Block-grid elements automatically align to the left and are pushed down to the next row individually as the viewport gets smaller...all without using media queries.
6 |
Block-grids consist of a table with class block-grid applied to it, along with a class in the pattern 'number-up' (ex. .two-up, .three-up, etc.) to describe how many even-sized elements should be placed per row. Extra care should be taken to ensure that there aren't any whitespace characters or newlines between the closing <td> of a block-grid element and the opening <td> of the preceding element, since some clients will render the whitespace as a gap between the elements.
7 |
Basic Block-Grid Markup
8 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | Column #1
18 |
19 |
20 |
21 | Column #2
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | ',
30 | 'html') ?>
31 |
32 |
Visual Example of Block-Grids
33 |
34 |
35 |
36 |
Examples
37 |
Multi-column Layouts in Gmail
38 |
A major use case for block-grids, since they don't rely on media queries, is to create multi-column layouts for Gmail. The simplest way to accomplish this is to create a .two-up block-grid and use the block-grid elements as your column structures. As a progressive enhancement, adding a media query that expands the columns to 100% width under 600px would cause the columns to take up the whole screen on mobile clients that support media queries, while not breaking the reflow pattern for those that don't.
Accent your emails with rich, high resolution images.
3 |
4 |
Markup
5 |
The days of having to choose between supporting Outlook or retina devices are over. To use high resolution images, put height and width HTML attributes on the <img> tag, corresponding to the scaled size of the image in a desktop view (the width of its .columns container). On small screen devices, Ink will cause the image to expand to its full width (or the width or its parent element, whichever is smaller).
6 |
Image Markup
7 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | ',
18 | 'html') ?>
19 |
20 |
21 |
Column Sizes
22 |
Below is a chart of the sizes images should be to fully fit various sizes of grid columns on a desktop (larger than 600px) view. Height should be determined with respect to width and should also be explicitly declared on the <img> tag.
23 |
24 |
25 |
Number of Columns
26 |
Internal Width (in px)
27 |
28 |
29 |
1
30 |
30
31 |
32 |
33 |
2
34 |
80
35 |
36 |
37 |
3
38 |
130
39 |
40 |
41 |
4
42 |
180
43 |
44 |
45 |
5
46 |
230
47 |
48 |
49 |
6
50 |
280
51 |
52 |
53 |
7
54 |
330
55 |
56 |
57 |
8
58 |
380
59 |
60 |
61 |
9
62 |
430
63 |
64 |
65 |
10
66 |
480
67 |
68 |
69 |
11
70 |
530
71 |
72 |
73 |
12
74 |
580
75 |
76 |
77 |
78 |
Examples
79 |
Newsletter Images
80 |
A common pattern in email newsletters is to have an image on the left with description text next to it. We use this layout quite frequently on ZURB emails and thought that it looked awkward when the small image begins to float in the center of the screen on mobile devices. To compensate for this, we use a full-width image that's scaled down on the desktop view.
81 |
Newsletter 3-9 Image
82 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | Text Content
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 | ',
115 | 'html') ?>
116 |
117 |
Retina Newsletter Image Demo
118 |
119 |
120 |
121 |
Compatibility
122 |
123 |
124 |
125 |
Retina images work as expected in most major email clients, with some caveats in Gmail (Mobile, iOS, Android).
Since the inline sizing will not be overwritten in mobile Gmail, retina images should not be used with block-grid based layouts (they're fine with the standard grid.
Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae.
140 |
Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae. consequat vel lacus. Sed iaculis pulvinar ligula, ornare fringilla ante viverra et. In hac habitasse platea dictumst. Donec vel orci mi, eu congue justo. Integer eget odio est, eget malesuada lorem. Aenean sed tellus dui, vitae viverra risus. Nullam massa sapien, pulvinar eleifend fringilla id, convallis eget nisi. Mauris a sagittis dui. Pellentesque non lacinia mi. Fusce sit amet libero sit amet erat venenatis sollicitudin vitae vel eros. Cras nunc sapien, interdum sit amet porttitor ut, congue quis urna.
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae. Click it! »
Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae.
140 |
Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae. consequat vel lacus. Sed iaculis pulvinar ligula, ornare fringilla ante viverra et. In hac habitasse platea dictumst. Donec vel orci mi, eu congue justo. Integer eget odio est, eget malesuada lorem. Aenean sed tellus dui, vitae viverra risus. Nullam massa sapien, pulvinar eleifend fringilla id, convallis eget nisi. Mauris a sagittis dui. Pellentesque non lacinia mi. Fusce sit amet libero sit amet erat venenatis sollicitudin vitae vel eros. Cras nunc sapien, interdum sit amet porttitor ut, congue quis urna.
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae. Click it! »
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et.
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra vitae. Click it! »
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
Title Ipsum This is a note.
181 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.