malvolio 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +7 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.lock +184 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +61 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/malvolio +6 -0
  12. data/bin/setup +8 -0
  13. data/lib/generators/malvolio/create_generator.rb +27 -0
  14. data/lib/generators/malvolio/create_with_inky_generator.rb +27 -0
  15. data/lib/generators/malvolio/templates/base/config.yaml +1 -0
  16. data/lib/generators/malvolio/templates/base/index.html +16 -0
  17. data/lib/generators/malvolio/templates/base/index.scss +0 -0
  18. data/lib/generators/malvolio/templates/base_with_inky/config.yaml +1 -0
  19. data/lib/generators/malvolio/templates/base_with_inky/index.html +22 -0
  20. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/_foundation_emails.scss +27 -0
  21. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/_global.scss +95 -0
  22. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_alignment.scss +88 -0
  23. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_button.scss +312 -0
  24. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_callout.scss +85 -0
  25. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_code.scss +0 -0
  26. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_media-query.scss +139 -0
  27. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_menu.scss +83 -0
  28. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_normalize.scss +86 -0
  29. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_outlook-first.scss +11 -0
  30. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_thumbnail.scss +49 -0
  31. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_typography.scss +404 -0
  32. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/components/_visibility.scss +66 -0
  33. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/grid/_block-grid.scss +32 -0
  34. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/grid/_grid.scss +180 -0
  35. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/settings/_settings.scss +148 -0
  36. data/lib/generators/malvolio/templates/base_with_inky/scss/foundation_emails/util/_util.scss +22 -0
  37. data/lib/generators/malvolio/templates/base_with_inky/scss/index.scss +1 -0
  38. data/lib/malvolio.rb +7 -0
  39. data/lib/malvolio/cli.rb +50 -0
  40. data/lib/malvolio/compiler.rb +85 -0
  41. data/lib/malvolio/version.rb +3 -0
  42. data/malvolio.gemspec +46 -0
  43. metadata +228 -0
@@ -0,0 +1,404 @@
1
+ // Foundation for Emails by ZURB
2
+ // zurb.com/ink/
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group typography
7
+ ////
8
+
9
+ /// Global font color.
10
+ /// @type Color
11
+ $global-font-color: $black !default;
12
+
13
+ /// Global font family.
14
+ /// @type Font
15
+ $body-font-family: Helvetica, Arial, sans-serif !default;
16
+
17
+ /// Global font weight.
18
+ /// @type Keyword
19
+ $global-font-weight: normal !default;
20
+
21
+ /// Header color
22
+ /// @type Color
23
+ $header-color: inherit !default;
24
+
25
+ /// Global line height.
26
+ /// @type Number
27
+ $global-line-height: 130% !default;
28
+
29
+ /// Font size of body text.
30
+ /// @type Number
31
+ $global-font-size: 16px !default;
32
+
33
+ /// Line height of body text.
34
+ /// @type Number
35
+ $body-line-height: $global-line-height !default;
36
+
37
+ /// Font family of headings.
38
+ /// @type List
39
+ $header-font-family: $body-font-family !default;
40
+
41
+ /// Font family of headings.
42
+ /// @type List
43
+ $header-font-weight: $global-font-weight !default;
44
+
45
+ /// Font size of `<h1>` elements.
46
+ /// @type Number
47
+ $h1-font-size: 34px !default;
48
+
49
+ /// Font size of `<h2>` elements.
50
+ /// @type Number
51
+ $h2-font-size: 30px !default;
52
+
53
+ /// Font size of `<h3>` elements.
54
+ /// @type Number
55
+ $h3-font-size: 28px !default;
56
+
57
+ /// Font size of `<h4>` elements.
58
+ /// @type Number
59
+ $h4-font-size: 24px !default;
60
+
61
+ /// Font size of `<h5>` elements.
62
+ /// @type Number
63
+ $h5-font-size: 20px !default;
64
+
65
+ /// Font size of `<h6>` elements.
66
+ /// @type Number
67
+ $h6-font-size: 18px !default;
68
+
69
+ /// Margin bottom of `<h1>` through `<h6>` elements.
70
+ /// @type Number
71
+ $header-margin-bottom: 10px !default;
72
+
73
+ /// Margin bottom of paragraphs.
74
+ /// @type Number
75
+ $paragraph-margin-bottom: 10px !default;
76
+
77
+ /// Default font size for `<small>`.
78
+ /// @type Number
79
+ $small-font-size: 80% !default;
80
+
81
+ /// Color of `<small>` elements when placed inside headers.
82
+ /// @type Color
83
+ $small-font-color: $medium-gray !default;
84
+
85
+ /// Font size of lead paragraphs.
86
+ /// @type Number
87
+ $lead-font-size: $global-font-size * 1.25 !default;
88
+
89
+ /// Line height of lead paragraphs.
90
+ /// @type Number
91
+ $lead-line-height: 160% !default;
92
+
93
+ /// Padding inside paragraphs.
94
+ /// @type Number
95
+ $text-padding: 10px !default;
96
+
97
+ /// Default line height for subheaders.
98
+ /// @type Number
99
+ $subheader-lineheight: 1.4 !default;
100
+
101
+ /// Default font color for subheaders.
102
+ /// @type Color
103
+ $subheader-color: $dark-gray !default;
104
+
105
+ /// Default font weight for subheaders.
106
+ /// @type String
107
+ $subheader-font-weight: $global-font-weight !default;
108
+
109
+ /// Default top margin for subhheaders.
110
+ /// @type Number
111
+ $subheader-margin-top: 4px !default;
112
+
113
+ /// Default bottom margin for subheaders.
114
+ /// @type Number
115
+ $subheader-margin-bottom: 8px !default;
116
+
117
+ /// Maximum width of a divider.
118
+ /// @type Number
119
+ $hr-width: $global-width !default;
120
+
121
+ /// Default border for a divider.
122
+ /// @type List
123
+ $hr-border: 1px solid $black !default;
124
+
125
+ /// Default margin for a divider.
126
+ /// @type Number | List
127
+ $hr-margin: 20px !default;
128
+
129
+ /// Default alignment for a divider.
130
+ /// @type String
131
+ $hr-align: center !default;
132
+
133
+ /// Text decoration for anchors.
134
+ /// @type Keyword
135
+ $anchor-text-decoration: none !default;
136
+
137
+ /// Text color of anchors.
138
+ /// @type Color
139
+ $anchor-color: $primary-color !default;
140
+
141
+ /// Text color of anchors to visited links.
142
+ /// @type Color
143
+ $anchor-color-visited: $anchor-color !default;
144
+
145
+ /// Text color of anchors on hover.
146
+ /// @type Color
147
+ $anchor-color-hover: darken($primary-color, 10%) !default;
148
+
149
+ /// Text color of active anchors.
150
+ /// @type Color
151
+ $anchor-color-active: $anchor-color-hover !default;
152
+
153
+ /// Default font size for statistic numbers.
154
+ /// @type Number
155
+ $stat-font-size: 40px !default;
156
+
157
+ /// Removing the iOS telephone and address styling
158
+ /// @type Boolean
159
+ $remove-ios-blue: true !default;
160
+
161
+ /// Create a divider/horizontal rule.
162
+ /// @param {String} $align - Left, center, or right
163
+ /// @param {String} $width - Width of divider
164
+ /// @param {String} $border - Shorthand border style for divider
165
+ /// @param {String} $margin - Margin above and below divider
166
+ @mixin h-line($align: $hr-align, $width: $hr-width, $border: $hr-border, $margin: nth($hr-margin, 1)) {
167
+ @at-root {
168
+ td.columns & table,
169
+ td.column & table,
170
+ th.columns & table,
171
+ th.column & table {
172
+ width: auto;
173
+ }
174
+ }
175
+
176
+ th {
177
+ padding-bottom: $margin;
178
+ @if $align == 'left' {
179
+ text-align: left;
180
+ } @elseif $align == 'right' {
181
+ text-align: right;
182
+ } @else {
183
+ text-align: center;
184
+ }
185
+ }
186
+
187
+ table {
188
+ display: inline-block;
189
+ margin: 0;
190
+ Margin: 0;
191
+ }
192
+
193
+ td {
194
+ width: $width;
195
+ height: 0;
196
+ padding-top: $margin;
197
+ clear: both;
198
+ border-top: 0;
199
+ border-right: 0;
200
+ border-bottom: $border;
201
+ border-left: 0;
202
+ font-size: 0;
203
+ line-height: 0;
204
+ }
205
+ }
206
+
207
+ body,
208
+ table.body,
209
+ h1,
210
+ h2,
211
+ h3,
212
+ h4,
213
+ h5,
214
+ h6,
215
+ p,
216
+ td,
217
+ th {
218
+ color: $global-font-color;
219
+ font-family: $body-font-family;
220
+ font-weight: $global-font-weight;
221
+ padding-top: 0;
222
+ padding-right: 0;
223
+ padding-bottom: 0;
224
+ padding-left: 0;
225
+ margin: 0;
226
+ Margin: 0;
227
+ text-align: left;
228
+ line-height: $global-line-height;
229
+ }
230
+
231
+ h1,
232
+ h2,
233
+ h3,
234
+ h4,
235
+ h5,
236
+ h6 {
237
+ color: $header-color;
238
+ word-wrap: normal;
239
+ font-family: $header-font-family;
240
+ font-weight: $header-font-weight;
241
+ margin-bottom: $header-margin-bottom;
242
+ Margin-bottom: $header-margin-bottom;
243
+ }
244
+
245
+ h1 {
246
+ font-size: $h1-font-size;
247
+ }
248
+
249
+ h2 {
250
+ font-size: $h2-font-size;
251
+ }
252
+
253
+ h3 {
254
+ font-size: $h3-font-size;
255
+ }
256
+
257
+ h4 {
258
+ font-size: $h4-font-size;
259
+ }
260
+
261
+ h5 {
262
+ font-size: $h5-font-size;
263
+ }
264
+
265
+ h6 {
266
+ font-size: $h6-font-size;
267
+ }
268
+
269
+ body,
270
+ table.body,
271
+ p,
272
+ td,
273
+ th {
274
+ font-size: $global-font-size;
275
+ line-height: $body-line-height;
276
+ }
277
+
278
+ p {
279
+ margin-bottom: $paragraph-margin-bottom;
280
+ Margin-bottom: $paragraph-margin-bottom;
281
+
282
+ &.lead {
283
+ font-size: $lead-font-size;
284
+ line-height: $lead-line-height;
285
+ }
286
+
287
+ &.subheader {
288
+ margin-top: $subheader-margin-top;
289
+ margin-bottom: $subheader-margin-bottom;
290
+ Margin-top: $subheader-margin-top;
291
+ Margin-bottom: $subheader-margin-bottom;
292
+ font-weight: $subheader-font-weight;
293
+ line-height: $subheader-lineheight;
294
+ color: $subheader-color;
295
+ }
296
+ }
297
+
298
+ small {
299
+ font-size: $small-font-size;
300
+ color: $small-font-color;
301
+ }
302
+
303
+ a {
304
+ color: $anchor-color;
305
+ text-decoration: $anchor-text-decoration;
306
+ font-family: $body-font-family;
307
+ font-weight: $global-font-weight;
308
+ padding: 0;
309
+ text-align: left;
310
+ line-height: $global-line-height;
311
+
312
+ &:hover {
313
+ color: $anchor-color-hover;
314
+ }
315
+
316
+ &:active {
317
+ color: $anchor-color-active;
318
+ }
319
+
320
+ &:visited {
321
+ color: $anchor-color-visited;
322
+ }
323
+ }
324
+
325
+ h1 a,
326
+ h1 a:visited,
327
+ h2 a,
328
+ h2 a:visited,
329
+ h3 a,
330
+ h3 a:visited,
331
+ h4 a,
332
+ h4 a:visited,
333
+ h5 a,
334
+ h5 a:visited,
335
+ h6 a,
336
+ h6 a:visited {
337
+ color: $anchor-color;
338
+ }
339
+
340
+ pre {
341
+ background: $light-gray;
342
+ margin: 30px 0;
343
+ Margin: 30px 0;
344
+
345
+ code {
346
+ color: $medium-gray;
347
+
348
+ span.callout {
349
+ color: $dark-gray;
350
+ font-weight: bold;
351
+ }
352
+
353
+ span.callout-strong {
354
+ color: $pre-color;
355
+ font-weight: bold;
356
+ }
357
+ }
358
+ }
359
+
360
+ // Horizontal rule
361
+ table.hr,
362
+ table.h-line {
363
+ @include h-line($hr-align, $hr-width, $hr-border, $hr-margin);
364
+ }
365
+
366
+ // Use to style a large number to display a statistic
367
+ .stat {
368
+ font-size: $stat-font-size;
369
+ line-height: 1;
370
+
371
+ p + & {
372
+ margin-top: -16px;
373
+ Margin-top: -16px;
374
+ }
375
+ }
376
+
377
+ // preheader styles
378
+ span.preheader {
379
+ display: none !important;
380
+ visibility: hidden;
381
+ mso-hide: all !important;
382
+ font-size: 1px;
383
+ color: $body-background; // needs to match background color of it's container
384
+ line-height: 1px;
385
+ max-height: 0px;
386
+ max-width: 0px;
387
+ opacity: 0;
388
+ overflow: hidden;
389
+ }
390
+
391
+ // Removing the iOS colors put in for telephone and addresses
392
+ @if $remove-ios-blue {
393
+ // Wrapping in a media only screen to have inline-css respect the styling
394
+ @media only screen {
395
+ a[x-apple-data-detectors] {
396
+ color: inherit !important;
397
+ text-decoration: none !important;
398
+ font-size: inherit !important;
399
+ font-family: inherit !important;
400
+ font-weight: inherit !important;
401
+ line-height: inherit !important;
402
+ }
403
+ }
404
+ }
@@ -0,0 +1,66 @@
1
+ // Foundation for Emails by ZURB
2
+ // zurb.com/ink/
3
+ // Licensed under MIT Open Source
4
+
5
+ ////
6
+ /// @group visibility
7
+ ////
8
+
9
+ .hide-for-large {
10
+ display: none;
11
+ mso-hide: all; // hide selected elements in Outlook 2007-2013
12
+ overflow: hidden;
13
+ max-height: 0;
14
+ font-size: 0;
15
+ width: 0;
16
+ line-height: 0;
17
+
18
+ @media only screen and (max-width: #{$global-breakpoint}) {
19
+ display: block !important;
20
+ width: auto !important;
21
+ overflow: visible !important;
22
+ max-height: none !important;
23
+ font-size: inherit !important;
24
+ line-height: inherit !important;
25
+ }
26
+ }
27
+
28
+ table.body table.container .hide-for-large * {
29
+ mso-hide: all; // hide selected elements in Outlook 2007-2013
30
+ }
31
+
32
+ table.body table.container .hide-for-large,
33
+ table.body table.container .row.hide-for-large {
34
+ @media only screen and (max-width: #{$global-breakpoint}) {
35
+ display: table !important;
36
+ width: 100% !important;
37
+ }
38
+ }
39
+
40
+ table.body table.container .callout-inner.hide-for-large {
41
+ @media only screen and (max-width: #{$global-breakpoint}) {
42
+ display: table-cell !important;
43
+ width: 100% !important;
44
+ }
45
+ }
46
+
47
+ table.body table.container .show-for-large {
48
+ @media only screen and (max-width: #{$global-breakpoint}) {
49
+ display: none !important;
50
+ width: 0;
51
+ mso-hide: all; // hide selected elements in Outlook 2007-2013
52
+ overflow: hidden;
53
+ }
54
+ }
55
+
56
+ // [todo] add image resets
57
+ // img {
58
+ // max-height: 0;
59
+ // width: 0;
60
+ // }
61
+ // in media query
62
+ // img {
63
+ // max-height: none !important;
64
+ // width: auto !important;
65
+ // }
66
+