bootstrap-email 1.0.0.alpha1.1 → 1.0.0.alpha3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/core/bootstrap-email.scss +2 -0
  4. data/core/bootstrap-head.scss +89 -16
  5. data/core/scss/_selectors_for_utils.scss +24 -0
  6. data/core/scss/_utilities.scss +24 -4
  7. data/core/scss/components/_grid.scss +25 -17
  8. data/core/scss/components/_stack.scss +39 -0
  9. data/core/scss/utilities/_sizing.scss +21 -2
  10. data/core/scss/utilities/_typography.scss +4 -10
  11. data/core/scss/utilities/_valign.scss +5 -0
  12. data/core/templates/body.html +9 -0
  13. data/core/templates/{container.html.erb → container.html} +4 -4
  14. data/core/templates/div.html +3 -0
  15. data/core/templates/table-left.html +9 -0
  16. data/core/templates/table-to-tbody.html +5 -0
  17. data/core/templates/table-to-tr.html +7 -0
  18. data/core/templates/table.html +9 -0
  19. data/core/templates/td.html +3 -0
  20. data/core/templates/tr.html +5 -0
  21. data/lib/{bootstrap_email.rb → bootstrap-email.rb} +6 -2
  22. data/lib/bootstrap-email/bootstrap_email_cli.rb +9 -9
  23. data/lib/bootstrap-email/compiler.rb +48 -65
  24. data/lib/bootstrap-email/config.rb +50 -0
  25. data/lib/bootstrap-email/{components → converters}/alert.rb +1 -1
  26. data/lib/bootstrap-email/converters/align.rb +22 -0
  27. data/lib/bootstrap-email/{components → converters}/badge.rb +1 -1
  28. data/lib/bootstrap-email/converters/base.rb +63 -0
  29. data/lib/bootstrap-email/converters/block.rb +13 -0
  30. data/lib/bootstrap-email/converters/body.rb +10 -0
  31. data/lib/bootstrap-email/{components → converters}/button.rb +1 -1
  32. data/lib/bootstrap-email/{components → converters}/card.rb +3 -3
  33. data/lib/bootstrap-email/{components → converters}/color.rb +1 -1
  34. data/lib/bootstrap-email/{components → converters}/container.rb +1 -1
  35. data/lib/bootstrap-email/converters/force_encoding.rb +16 -0
  36. data/lib/bootstrap-email/converters/grid.rb +14 -0
  37. data/lib/bootstrap-email/converters/head_style.rb +33 -0
  38. data/lib/bootstrap-email/{components → converters}/hr.rb +2 -2
  39. data/lib/bootstrap-email/{components → converters}/margin.rb +3 -3
  40. data/lib/bootstrap-email/converters/padding.rb +16 -0
  41. data/lib/bootstrap-email/converters/paragraph.rb +13 -0
  42. data/lib/bootstrap-email/converters/preview_text.rb +18 -0
  43. data/lib/bootstrap-email/{components → converters}/spacer.rb +1 -1
  44. data/lib/bootstrap-email/{components → converters}/spacing.rb +5 -6
  45. data/lib/bootstrap-email/converters/stack.rb +30 -0
  46. data/lib/bootstrap-email/{components → converters}/table.rb +1 -1
  47. data/lib/bootstrap-email/converters/version_comment.rb +15 -0
  48. data/lib/bootstrap-email/erb.rb +9 -0
  49. data/lib/bootstrap-email/rails/action_mailer.rb +7 -2
  50. data/lib/bootstrap-email/sass_cache.rb +43 -26
  51. data/lib/bootstrap-email/setup.rb +27 -0
  52. metadata +44 -31
  53. data/core/templates/body.html.erb +0 -9
  54. data/core/templates/col.html.erb +0 -3
  55. data/core/templates/div.html.erb +0 -3
  56. data/core/templates/row.html.erb +0 -7
  57. data/core/templates/table-left.html.erb +0 -9
  58. data/core/templates/table.html.erb +0 -9
  59. data/lib/bootstrap-email/components/align.rb +0 -21
  60. data/lib/bootstrap-email/components/base.rb +0 -26
  61. data/lib/bootstrap-email/components/body.rb +0 -22
  62. data/lib/bootstrap-email/components/grid.rb +0 -14
  63. data/lib/bootstrap-email/components/padding.rb +0 -16
  64. data/lib/bootstrap-email/components/paragraph.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e24aee0c8377f6497e1e0598262cc39e65eb07cc6aa520c5b644d5e5507d712e
4
- data.tar.gz: 4bc3678c69852ae32fa1533bd8fef2eb5f4ad9fab2f7ecac5a171db2a1a6c0c9
3
+ metadata.gz: 75655e6d12a24abed3f9cf4fee65bc198210d1e9289196b8df80bd53791c21b2
4
+ data.tar.gz: 365aedf89fa3f0818ecb6808762d75045855e542172d5ad3440cb5c69dbdc748
5
5
  SHA512:
6
- metadata.gz: 75bb3a64345077bd4e4621106efa1a89b7df1237b4f492d77db28fc88a2b17eb24b1b2a1ba3e6bdf52fface8c4fef64e0f3580fa141b915365ca1e0182ce7cfb
7
- data.tar.gz: a030f98e7ae7c5f26bdc2fa2f31dce874ab94859a3e5ea0d61eaf1703694a8a3be3caa14559d8b0fda9f42afa03fff2bdff0a1409f650c6b85014406e89bbc41
6
+ metadata.gz: 80c34ce66af8e2024fa3547a08c1ec4330ddf77c7e25297753edd164b54586f811c19b2722df572f296fa006227b950c0803e7769fc7a523ed4cba0c1bc451d1
7
+ data.tar.gz: 38b53f2516bbd1f46fea866b06170174d89333f7d8b44a42bb36d7220af717ae97ab0e9967898ded0544584d120b59bde6d22c78023e562c1254460db6c7c9f0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0.alpha1.1
1
+ 1.0.0.alpha3.1
@@ -16,6 +16,7 @@
16
16
  @import 'scss/components/image';
17
17
  @import 'scss/components/preview';
18
18
  @import 'scss/components/table';
19
+ @import 'scss/components/stack';
19
20
 
20
21
  @import 'scss/utilities/background';
21
22
  @import 'scss/utilities/border';
@@ -26,3 +27,4 @@
26
27
  @import 'scss/utilities/spacing';
27
28
  @import 'scss/utilities/text-decoration';
28
29
  @import 'scss/utilities/typography';
30
+ @import 'scss/utilities/valign';
@@ -8,6 +8,11 @@
8
8
  @import 'scss/selectors_for_utils';
9
9
  @import 'scss/helper_groups';
10
10
 
11
+ // Force base font in Outlook
12
+ body, table, td {
13
+ font-family: $font-family-base !important;
14
+ }
15
+
11
16
  // Forces Outlook.com to display emails at full width
12
17
  .ExternalClass {
13
18
  width: 100%;
@@ -28,7 +33,7 @@ a {
28
33
  text-decoration: none;
29
34
  }
30
35
 
31
- // Inhere text color so color can be set on the body and inherited by children
36
+ // Inherit text color so color can be set on the body and inherited by children
32
37
  * {
33
38
  color: inherit;
34
39
  }
@@ -66,18 +71,57 @@ table:not([class^=s-]) {
66
71
  /*! allow_purge_after */
67
72
 
68
73
  @media screen and (max-width: 600px) {
74
+ // Row Gap
75
+ @each $space, $value in $spacers {
76
+ .gap-#{$space}.row,
77
+ .gap-x-#{$space}.row {
78
+ margin-right: -1 * $value !important;
79
+ & > table > tbody > tr > td {
80
+ padding-right: $value !important;
81
+ }
82
+ }
83
+ .gap-#{$space}.row,
84
+ .gap-y-#{$space}.row {
85
+ margin-bottom: -1 * $value !important;
86
+ & > table > tbody > tr > td {
87
+ padding-bottom: $value !important;
88
+ }
89
+ }
90
+ }
91
+
92
+ // Stack Gap
93
+ @each $space, $value in $spacers {
94
+ table.gap-lg-#{$space}.stack-x > tbody > tr > td {
95
+ padding-right: 0 !important;
96
+ }
97
+ table.gap-lg-#{$space}.stack-y > tbody > tr > td {
98
+ padding-bottom: 0 !important;
99
+ }
100
+ }
101
+ @each $space, $value in $spacers {
102
+ table.gap-#{$space}.stack-x > tbody > tr > td {
103
+ padding-right: $value !important;
104
+ }
105
+ table.gap-#{$space}.stack-y > tbody > tr > td {
106
+ padding-bottom: $value !important;
107
+ }
108
+ }
109
+
69
110
  // Grid
70
111
  @each $key, $value in $grid-cols {
71
- table.row > tbody > tr {
72
- & > td.col-lg-#{$key},
73
- & > td.col-lg {
74
- display: block;
75
- width: 100% !important;
76
- padding-left: 0 !important;
77
- padding-right: 0 !important;
78
- }
112
+ td.col-lg-#{$key} {
113
+ display: block;
114
+ width: 100% !important;
115
+ padding-left: 0 !important;
116
+ padding-right: 0 !important;
79
117
  }
80
118
  }
119
+ td.col-lg {
120
+ display: block;
121
+ width: 100% !important;
122
+ padding-left: 0 !important;
123
+ padding-right: 0 !important;
124
+ }
81
125
 
82
126
  // Display
83
127
  @each $display in $display-type {
@@ -91,26 +135,56 @@ table:not([class^=s-]) {
91
135
  }
92
136
  }
93
137
 
94
- // Sizing
138
+ // Sizing Max Width / Height
139
+ @each $name, $property in $sizing-types {
140
+ @include sizing-util('.max-#{$name}-lg-full') {
141
+ max-#{$property}: unset !important;
142
+ #{$property}: auto !important;
143
+ }
144
+ @each $size, $value in $sizing {
145
+ @include sizing-util('.max-#{$name}-lg-#{$size}') {
146
+ max-#{$property}: unset !important;
147
+ #{$property}: auto !important;
148
+ }
149
+ }
150
+ }
151
+ @each $name, $property in $sizing-types {
152
+ @include sizing-util('.max-#{$name}-full') {
153
+ max-#{$property}: 100% !important;
154
+ #{$property}: 100% !important;
155
+ }
156
+ @each $size, $value in $sizing {
157
+ @include sizing-util('.max-#{$name}-#{$size}') {
158
+ max-#{$property}: $value !important;
159
+ #{$property}: 100% !important;
160
+ }
161
+ }
162
+ }
163
+
164
+ // Sizing Width / Height
95
165
  @each $name, $property in $sizing-types {
96
166
  @include sizing-util('.#{$name}-lg-full') {
97
- max-#{$property}: auto !important;
167
+ #{$property}: auto !important;
168
+ }
169
+ @include sizing-util('.#{$name}-lg-auto') {
98
170
  #{$property}: auto !important;
99
171
  }
100
172
  @each $size, $value in $sizing {
101
173
  @include sizing-util('.#{$name}-lg-#{$size}') {
102
- max-#{$property}: auto !important;
103
174
  #{$property}: auto !important;
104
175
  }
105
176
  }
177
+ }
178
+ @each $name, $property in $sizing-types {
106
179
  @include sizing-util('.#{$name}-full') {
107
- max-#{$property}: 100% !important;
108
180
  #{$property}: 100% !important;
109
181
  }
182
+ @include sizing-util('.#{$name}-auto') {
183
+ #{$property}: auto !important;
184
+ }
110
185
  @each $size, $value in $sizing {
111
186
  @include sizing-util('.#{$name}-#{$size}') {
112
- max-#{$property}: $value !important;
113
- #{$property}: 100% !important;
187
+ #{$property}: $value !important;
114
188
  }
115
189
  }
116
190
  }
@@ -132,7 +206,6 @@ table:not([class^=s-]) {
132
206
  line-height: 0 !important;
133
207
  height: 0 !important;
134
208
  }
135
-
136
209
  @each $size, $value in $spacers {
137
210
  @include spacer-util('.s-#{$size}') {
138
211
  font-size: $value !important;
@@ -98,3 +98,27 @@
98
98
  }
99
99
  }
100
100
  }
101
+
102
+ //
103
+ // Text align
104
+ //
105
+ @mixin text-align-util($class) {
106
+ #{$class} {
107
+ &,
108
+ & > tbody > tr > td {
109
+ @content
110
+ }
111
+ }
112
+ }
113
+
114
+ //
115
+ // Vertical align
116
+ //
117
+ @mixin valign-util($class) {
118
+ #{$class} {
119
+ &,
120
+ & > tbody > tr > td {
121
+ @content
122
+ }
123
+ }
124
+ }
@@ -117,9 +117,29 @@ $border-widths: (
117
117
  ) !default;
118
118
 
119
119
  $border-radiuses: (
120
- '-sm': 3px,
121
- '': 6px,
122
- '-lg': 9px,
120
+ '': 4px,
121
+ '-none': 0px,
122
+ '-sm': 2px,
123
+ '-md': 6px,
124
+ '-lg': 8px,
123
125
  '-xl': 12px,
124
- '-0': 0px
126
+ '-2xl': 16px,
127
+ '-3xl': 24px,
128
+ '-full': 9999px
129
+ ) !default;
130
+
131
+ $vertical-align: (
132
+ top,
133
+ middle,
134
+ bottom,
135
+ baseline,
136
+ text-top,
137
+ text-bottom
138
+ ) !default;
139
+
140
+ $text-align: (
141
+ left,
142
+ right,
143
+ center,
144
+ justify
125
145
  ) !default;
@@ -1,10 +1,16 @@
1
- table.row {
2
- table-layout: fixed;
3
- width: 100%;
4
- & > tbody > tr > td {
5
- min-height: 1px;
6
- font-weight: normal;
7
- padding-right: 30px;
1
+ .row {
2
+ margin-right: -24px;
3
+ & > table {
4
+ table-layout: fixed;
5
+ -premailer-width: 100%;
6
+ width: 100%;
7
+ & > tbody > tr > td {
8
+ min-height: 1px;
9
+ font-weight: normal;
10
+ padding-right: 24px;
11
+ vertical-align: top;
12
+ text-align: left;
13
+ }
8
14
  }
9
15
  }
10
16
 
@@ -16,19 +22,21 @@ table.row {
16
22
  }
17
23
 
18
24
  @each $space, $value in $spacers {
19
- table.row.g-#{$space},
20
- table.row.gx-#{$space},
21
- table.row.g-lg-#{$space},
22
- table.row.gx-lg-#{$space} {
23
- & > tbody > tr > td {
25
+ .row.gap-#{$space},
26
+ .row.gap-x-#{$space},
27
+ .row.gap-lg-#{$space},
28
+ .row.gap-x-lg-#{$space} {
29
+ margin-right: -1 * $value;
30
+ & > table > tbody > tr > td {
24
31
  padding-right: $value;
25
32
  }
26
33
  }
27
- table.row.g-#{$space},
28
- table.row.gy-#{$space},
29
- table.row.g-lg-#{$space},
30
- table.row.gy-lg-#{$space} {
31
- & > tbody > tr > td {
34
+ .row.gap-#{$space},
35
+ .row.gap-y-#{$space},
36
+ .row.gap-lg-#{$space},
37
+ .row.gap-y-lg-#{$space} {
38
+ margin-bottom: -1 * $value;
39
+ & > table > tbody > tr > td {
32
40
  padding-bottom: $value;
33
41
  }
34
42
  }
@@ -0,0 +1,39 @@
1
+ @each $space, $value in $spacers {
2
+ table.stack-x.gap-#{$space},
3
+ table.stack-x.gap-lg-#{$space} {
4
+ & > tbody > tr > td {
5
+ padding-right: $value;
6
+ &:last-child {
7
+ padding-right: 0;
8
+ }
9
+ }
10
+ }
11
+ table.stack-y.gap-#{$space},
12
+ table.stack-y.gap-lg-#{$space} {
13
+ & > tbody > tr {
14
+ & > td {
15
+ padding-bottom: $value;
16
+ }
17
+ &:last-child > td {
18
+ padding-bottom: 0;
19
+ }
20
+ }
21
+ }
22
+ }
23
+
24
+ .stack-cell {
25
+ vertical-align: top;
26
+ text-align: left;
27
+ }
28
+
29
+ @each $align in $vertical-align {
30
+ table.stack-valign-#{$align} > tbody > tr > td {
31
+ vertical-align: $align;
32
+ }
33
+ }
34
+
35
+ @each $align in $text-align {
36
+ table.stack-align-#{$align} > tbody > tr > td {
37
+ text-align: $align;
38
+ }
39
+ }
@@ -1,12 +1,12 @@
1
1
  @each $prefix in $breakpoints {
2
2
  @each $name, $property in $sizing-types {
3
- @include sizing-util('.#{$name}-#{$prefix}full') {
3
+ @include sizing-util('.max-#{$name}-#{$prefix}full') {
4
4
  max-#{$property}: 100%;
5
5
  -premailer-#{$property}: 100%;
6
6
  #{$property}: 100%;
7
7
  }
8
8
  @each $size, $value in $sizing {
9
- @include sizing-util('.#{$name}-#{$prefix}#{$size}') {
9
+ @include sizing-util('.max-#{$name}-#{$prefix}#{$size}') {
10
10
  max-#{$property}: $value;
11
11
  -premailer-#{$property}: strip-unit($value);
12
12
  #{$property}: 100%;
@@ -14,3 +14,22 @@
14
14
  }
15
15
  }
16
16
  }
17
+
18
+ @each $prefix in $breakpoints {
19
+ @each $name, $property in $sizing-types {
20
+ @include sizing-util('.#{$name}-#{$prefix}full') {
21
+ -premailer-#{$property}: 100%;
22
+ #{$property}: 100%;
23
+ }
24
+ @include sizing-util('.#{$name}-#{$prefix}auto') {
25
+ -premailer-#{$property}: auto;
26
+ #{$property}: auto;
27
+ }
28
+ @each $size, $value in $sizing {
29
+ @include sizing-util('.#{$name}-#{$prefix}#{$size}') {
30
+ -premailer-#{$property}: strip-unit($value);
31
+ #{$property}: $value;
32
+ }
33
+ }
34
+ }
35
+ }
@@ -36,16 +36,10 @@ h1, h2, h3, h4, h5, h6,
36
36
  }
37
37
  }
38
38
 
39
- .text-left {
40
- text-align: left !important;
41
- }
42
-
43
- .text-right {
44
- text-align: right !important;
45
- }
46
-
47
- .text-center {
48
- text-align: center !important;
39
+ @each $align in $text-align {
40
+ @include text-align-util('.text-#{$align}') {
41
+ text-align: $align !important;
42
+ }
49
43
  }
50
44
 
51
45
  p {
@@ -0,0 +1,5 @@
1
+ @each $align in $vertical-align {
2
+ @include valign-util('.valign-#{$align}') {
3
+ vertical-align: $align !important;
4
+ }
5
+ }
@@ -0,0 +1,9 @@
1
+ <table class="{{ classes }}" valign="top" role="presentation">
2
+ <tbody>
3
+ <tr>
4
+ <td valign="top">
5
+ {{ contents }}
6
+ </td>
7
+ </tr>
8
+ </tbody>
9
+ </table>
@@ -1,18 +1,18 @@
1
- <table class="<%= classes %>">
1
+ <table class="{{ classes }}" role="presentation">
2
2
  <tbody>
3
3
  <tr>
4
4
  <td align="center">
5
5
  <!--[if (gte mso 9)|(IE)]>
6
- <table align="center">
6
+ <table align="center" role="presentation">
7
7
  <tbody>
8
8
  <tr>
9
9
  <td width="600">
10
10
  <![endif]-->
11
- <table align="center">
11
+ <table align="center" role="presentation">
12
12
  <tbody>
13
13
  <tr>
14
14
  <td>
15
- <%= contents %>
15
+ {{ contents }}
16
16
  </td>
17
17
  </tr>
18
18
  </tbody>