bootstrap-email 0.3.2 → 1.0.0.alpha1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/bin/bootstrap-email +2 -0
  4. data/core/bootstrap-email.scss +27 -18
  5. data/core/bootstrap-head.scss +143 -0
  6. data/core/layout.html.erb +11 -0
  7. data/core/scss/_colors.scss +161 -0
  8. data/core/scss/_functions.scss +29 -0
  9. data/core/scss/_helper_groups.scss +21 -0
  10. data/core/{sass → scss}/_reboot_email.scss +7 -22
  11. data/core/scss/_selectors_for_utils.scss +100 -0
  12. data/core/scss/_utilities.scss +125 -0
  13. data/core/scss/_variables.scss +52 -0
  14. data/core/{sass → scss/components}/_alert.scss +0 -1
  15. data/core/{sass → scss/components}/_badge.scss +8 -15
  16. data/core/{sass → scss/components}/_button.scss +21 -17
  17. data/core/{sass → scss/components}/_card.scss +3 -2
  18. data/core/{sass → scss/components}/_container.scss +0 -0
  19. data/core/scss/components/_grid.scss +35 -0
  20. data/core/scss/components/_hr.scss +8 -0
  21. data/core/{sass → scss/components}/_image.scss +2 -1
  22. data/core/{sass → scss/components}/_preview.scss +0 -0
  23. data/core/{sass → scss/components}/_table.scss +0 -0
  24. data/core/scss/utilities/_background.scss +5 -0
  25. data/core/scss/utilities/_border-radius.scss +21 -0
  26. data/core/scss/utilities/_border.scss +13 -0
  27. data/core/scss/utilities/_color.scss +9 -0
  28. data/core/scss/utilities/_display.scss +7 -0
  29. data/core/scss/utilities/_sizing.scss +16 -0
  30. data/core/scss/utilities/_spacing.scss +18 -0
  31. data/core/scss/utilities/_text-decoration.scss +9 -0
  32. data/core/scss/utilities/_typography.scss +54 -0
  33. data/core/templates/col.html.erb +2 -2
  34. data/core/templates/row.html.erb +2 -2
  35. data/lib/bootstrap-email/bootstrap_email_cli.rb +92 -0
  36. data/lib/bootstrap-email/compiler.rb +118 -0
  37. data/lib/bootstrap-email/components/alert.rb +11 -0
  38. data/lib/bootstrap-email/components/align.rb +21 -0
  39. data/lib/bootstrap-email/components/badge.rb +11 -0
  40. data/lib/bootstrap-email/components/base.rb +26 -0
  41. data/lib/bootstrap-email/components/body.rb +22 -0
  42. data/lib/bootstrap-email/components/button.rb +11 -0
  43. data/lib/bootstrap-email/components/card.rb +14 -0
  44. data/lib/bootstrap-email/components/color.rb +13 -0
  45. data/lib/bootstrap-email/components/container.rb +14 -0
  46. data/lib/bootstrap-email/components/grid.rb +14 -0
  47. data/lib/bootstrap-email/components/hr.rb +12 -0
  48. data/lib/bootstrap-email/components/margin.rb +22 -0
  49. data/lib/bootstrap-email/components/padding.rb +16 -0
  50. data/lib/bootstrap-email/components/paragraph.rb +24 -0
  51. data/lib/bootstrap-email/components/spacer.rb +11 -0
  52. data/lib/bootstrap-email/components/spacing.rb +18 -0
  53. data/lib/bootstrap-email/components/table.rb +13 -0
  54. data/lib/bootstrap-email/initialize.rb +1 -0
  55. data/lib/bootstrap-email/rails/action_mailer.rb +10 -0
  56. data/lib/bootstrap-email/{engine.rb → rails/engine.rb} +0 -0
  57. data/lib/bootstrap-email/sass_cache.rb +47 -0
  58. data/lib/bootstrap-email/version.rb +3 -5
  59. data/lib/bootstrap_email.rb +27 -0
  60. metadata +75 -63
  61. data/core/head.scss +0 -269
  62. data/core/sass/_border.scss +0 -73
  63. data/core/sass/_color.scss +0 -33
  64. data/core/sass/_display.scss +0 -7
  65. data/core/sass/_functions.scss +0 -14
  66. data/core/sass/_grid.scss +0 -131
  67. data/core/sass/_hr.scss +0 -14
  68. data/core/sass/_spacing.scss +0 -100
  69. data/core/sass/_typography.scss +0 -50
  70. data/core/sass/_variables.scss +0 -150
  71. data/core/template.html.erb +0 -11
  72. data/core/templates/align-center.html.erb +0 -9
  73. data/core/templates/align-left.html.erb +0 -9
  74. data/core/templates/align-right.html.erb +0 -9
  75. data/core/templates/hr.html.erb +0 -9
  76. data/lib/assets/stylesheets/bootstrap-email.scss +0 -1
  77. data/lib/bootstrap-email.rb +0 -230
  78. data/lib/bootstrap-email/action_mailer.rb +0 -12
  79. data/lib/bootstrap-email/premailer_railtie.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62c6c5c793d4efc84cce78d500c28962ed044dcb2ee4cfa340ac366711d78275
4
- data.tar.gz: 591fe6126e0b9029ba96fa8d6c00ce99dae098a08a590d70f8aed75893dde83d
3
+ metadata.gz: dff167ba86e6d966e96d13e01988af9c06a734b2f7bef9fd9c67dac20ba97d72
4
+ data.tar.gz: 3a9c52a5b39f2c6a18c0b4e646eedf24c3051eef56a168d3c8fb18ece7daa92a
5
5
  SHA512:
6
- metadata.gz: '048c1bb0ed2d42b612e4fa052e6dc8f0872cb474aaa06664b6b3030f07f226d572213de43b459575ffca84d5ec75936c0341fbaa59a6fa47e9b490a47ff6c750'
7
- data.tar.gz: 14ab4f2fe71b5966e39dedc63283851b9d9650f7a2bbebe3cf2ac30e69e2ca59465101c4536935f1e77e08e285df70d1c94e9338bb1404dbce4545e40a3113c3
6
+ metadata.gz: 8ce16ed9d76b94341b7ee39ac4633133d4dc70fa9d2a4952cdef848c61601006bee71452aff8fa9959e303c7970d3e96072459e1d7708bd6d259be2eb36aa6fa
7
+ data.tar.gz: 03b4b339a9c43b802b93e8d71dd8c5465ba0e085fc9a28063e09c75ed127adefa02b8f6f1e56b06b455c776cea23f74566e09706fac5333ba440defb5067cc94
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 1.0.0.alpha1.2
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../lib/bootstrap-email/bootstrap_email_cli'
@@ -1,19 +1,28 @@
1
- @import 'sass/functions';
2
- @import 'sass/variables';
1
+ @import 'scss/functions';
2
+ @import 'scss/colors';
3
+ @import 'scss/variables';
4
+ @import 'scss/utilities';
5
+ @import 'scss/selectors_for_utils';
6
+ @import 'scss/helper_groups';
7
+ @import 'scss/reboot_email';
3
8
 
4
- @import 'sass/reboot_email';
5
- @import 'sass/button';
6
- @import 'sass/display';
7
- @import 'sass/grid';
8
- @import 'sass/card';
9
- @import 'sass/container';
10
- @import 'sass/badge';
11
- @import 'sass/table';
12
- @import 'sass/hr';
13
- @import 'sass/alert';
14
- @import 'sass/image';
15
- @import 'sass/typography';
16
- @import 'sass/color';
17
- @import 'sass/preview';
18
- @import 'sass/spacing';
19
- @import 'sass/border';
9
+ @import 'scss/components/alert';
10
+ @import 'scss/components/badge';
11
+ @import 'scss/components/button';
12
+ @import 'scss/components/card';
13
+ @import 'scss/components/container';
14
+ @import 'scss/components/grid';
15
+ @import 'scss/components/hr';
16
+ @import 'scss/components/image';
17
+ @import 'scss/components/preview';
18
+ @import 'scss/components/table';
19
+
20
+ @import 'scss/utilities/background';
21
+ @import 'scss/utilities/border';
22
+ @import 'scss/utilities/border-radius';
23
+ @import 'scss/utilities/color';
24
+ @import 'scss/utilities/display';
25
+ @import 'scss/utilities/sizing';
26
+ @import 'scss/utilities/spacing';
27
+ @import 'scss/utilities/text-decoration';
28
+ @import 'scss/utilities/typography';
@@ -0,0 +1,143 @@
1
+ //
2
+ // This file will be placed in the head of the document and will not be inlined
3
+ //
4
+ @import 'scss/functions';
5
+ @import 'scss/colors';
6
+ @import 'scss/variables';
7
+ @import 'scss/utilities';
8
+ @import 'scss/selectors_for_utils';
9
+ @import 'scss/helper_groups';
10
+
11
+ // Forces Outlook.com to display emails at full width
12
+ .ExternalClass {
13
+ width: 100%;
14
+ }
15
+
16
+ // Forces Outlook.com to display normal line spacing, here is more on that: http://www.emailonacid.com/forum/viewthread/43/
17
+ .ExternalClass,
18
+ .ExternalClass p,
19
+ .ExternalClass span,
20
+ .ExternalClass font,
21
+ .ExternalClass td,
22
+ .ExternalClass div {
23
+ line-height: 150%;
24
+ }
25
+
26
+ // Prevent Windows 10 Mail from underlining links. Styles for underlined links should be inlined
27
+ a {
28
+ text-decoration: none;
29
+ }
30
+
31
+ // Inhere text color so color can be set on the body and inherited by children
32
+ * {
33
+ color: inherit;
34
+ }
35
+
36
+ // Fix link colors set on automatic detection such as email addresses and phone numbers
37
+ a[x-apple-data-detectors],
38
+ u + #body a,
39
+ #MessageViewBody a {
40
+ color: inherit;
41
+ text-decoration: none;
42
+ font-size: inherit;
43
+ font-family: inherit;
44
+ font-weight: inherit;
45
+ line-height: inherit;
46
+ }
47
+
48
+ // Use a better rendering method when resizing images in Outlook IE.
49
+ img {
50
+ -ms-interpolation-mode: bicubic;
51
+ }
52
+
53
+ // Prevent Outlook from adding extra spacing to tables.
54
+ table:not([class^=s-]) {
55
+ font-family: $font-family-base;
56
+ mso-table-lspace: 0pt;
57
+ mso-table-rspace: 0pt;
58
+ border-spacing: 0px;
59
+ border-collapse: collapse;
60
+ td {
61
+ border-spacing: 0px;
62
+ border-collapse: collapse;
63
+ }
64
+ }
65
+
66
+ /*! allow_purge_after */
67
+
68
+ @media screen and (max-width: 600px) {
69
+ // Grid
70
+ @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
+ }
79
+ }
80
+ }
81
+
82
+ // Display
83
+ @each $display in $display-type {
84
+ .d-lg-#{$display} {
85
+ display: unset !important;
86
+ }
87
+ }
88
+ @each $display in $display-type {
89
+ .d-#{$display} {
90
+ display: $display !important;
91
+ }
92
+ }
93
+
94
+ // Sizing
95
+ @each $name, $property in $sizing-types {
96
+ @include sizing-util('.#{$name}-lg-full') {
97
+ max-#{$property}: auto !important;
98
+ #{$property}: auto !important;
99
+ }
100
+ @each $size, $value in $sizing {
101
+ @include sizing-util('.#{$name}-lg-#{$size}') {
102
+ max-#{$property}: auto !important;
103
+ #{$property}: auto !important;
104
+ }
105
+ }
106
+ @include sizing-util('.#{$name}-full') {
107
+ max-#{$property}: 100% !important;
108
+ #{$property}: 100% !important;
109
+ }
110
+ @each $size, $value in $sizing {
111
+ @include sizing-util('.#{$name}-#{$size}') {
112
+ max-#{$property}: $value !important;
113
+ #{$property}: 100% !important;
114
+ }
115
+ }
116
+ }
117
+
118
+ // Spacing
119
+ // Reset large padding to 0 on small device
120
+ @each $size, $value in $spacers {
121
+ @include padding-group('lg-', $size, unquote('0 !important'));
122
+ }
123
+
124
+ // Set proper padding on small devices
125
+ @each $size, $value in $spacers {
126
+ @include padding-group('', $size, unquote('#{$value} !important'));
127
+ }
128
+
129
+ // Spacers
130
+ @include spacer-util('*[class*=s-lg-]') {
131
+ font-size: 0 !important;
132
+ line-height: 0 !important;
133
+ height: 0 !important;
134
+ }
135
+
136
+ @each $size, $value in $spacers {
137
+ @include spacer-util('.s-#{$size}') {
138
+ font-size: $value !important;
139
+ line-height: $value !important;
140
+ height: $value !important;
141
+ }
142
+ }
143
+ }
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <meta name="x-apple-disable-message-reformatting">
6
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ <meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
9
+ </head>
10
+ <%= contents %>
11
+ </html>
@@ -0,0 +1,161 @@
1
+ // Color system
2
+ $white: #ffffff !default;
3
+ $gray-100: #f7fafc !default;
4
+ $gray-200: #edf2f7 !default;
5
+ $gray-300: #e2e8f0 !default;
6
+ $gray-400: #cbd5e0 !default;
7
+ $gray-500: #a0aec0 !default;
8
+ $gray-600: #718096 !default;
9
+ $gray-700: #4a5568 !default;
10
+ $gray-800: #2d3748 !default;
11
+ $gray-900: #1a202c !default;
12
+ $black: #000000 !default;
13
+
14
+ $blue: #0d6efd !default;
15
+ $indigo: #6610f2 !default;
16
+ $purple: #6f42c1 !default;
17
+ $pink: #d63384 !default;
18
+ $red: #dc3545 !default;
19
+ $orange: #fd7e14 !default;
20
+ $yellow: #ffc107 !default;
21
+ $green: #198754 !default;
22
+ $teal: #20c997 !default;
23
+ $cyan: #0dcaf0 !default;
24
+
25
+ $primary: $blue !default;
26
+ $secondary: $gray-600 !default;
27
+ $success: $green !default;
28
+ $info: $cyan !default;
29
+ $warning: $yellow !default;
30
+ $danger: $red !default;
31
+ $light: $gray-100 !default;
32
+ $dark: $gray-900 !default;
33
+
34
+ $theme-colors: (
35
+ "primary": $primary,
36
+ "secondary": $secondary,
37
+ "success": $success,
38
+ "info": $info,
39
+ "warning": $warning,
40
+ "danger": $danger,
41
+ "light": $light,
42
+ "dark": $dark
43
+ ) !default;
44
+
45
+ $palette-colors: (
46
+ "black": $black,
47
+ "white": $white,
48
+ "transparent": "transparent",
49
+
50
+ "gray-100": $gray-100,
51
+ "gray-200": $gray-200,
52
+ "gray-300": $gray-300,
53
+ "gray-400": $gray-400,
54
+ "gray-500": $gray-500,
55
+ "gray-600": $gray-600,
56
+ "gray-700": $gray-700,
57
+ "gray-800": $gray-800,
58
+ "gray-900": $gray-900,
59
+
60
+ "blue-100": tint-color($blue, 80%),
61
+ "blue-200": tint-color($blue, 60%),
62
+ "blue-300": tint-color($blue, 40%),
63
+ "blue-400": tint-color($blue, 20%),
64
+ "blue-500": $blue,
65
+ "blue-600": shade-color($blue, 20%),
66
+ "blue-700": shade-color($blue, 40%),
67
+ "blue-800": shade-color($blue, 60%),
68
+ "blue-900": shade-color($blue, 80%),
69
+
70
+ "indigo-100": tint-color($indigo, 80%),
71
+ "indigo-200": tint-color($indigo, 60%),
72
+ "indigo-300": tint-color($indigo, 40%),
73
+ "indigo-400": tint-color($indigo, 20%),
74
+ "indigo-500": $indigo,
75
+ "indigo-600": shade-color($indigo, 20%),
76
+ "indigo-700": shade-color($indigo, 40%),
77
+ "indigo-800": shade-color($indigo, 60%),
78
+ "indigo-900": shade-color($indigo, 80%),
79
+
80
+ "purple-100": tint-color($purple, 80%),
81
+ "purple-200": tint-color($purple, 60%),
82
+ "purple-300": tint-color($purple, 40%),
83
+ "purple-400": tint-color($purple, 20%),
84
+ "purple-500": $purple,
85
+ "purple-600": shade-color($purple, 20%),
86
+ "purple-700": shade-color($purple, 40%),
87
+ "purple-800": shade-color($purple, 60%),
88
+ "purple-900": shade-color($purple, 80%),
89
+
90
+ "pink-100": tint-color($pink, 80%),
91
+ "pink-200": tint-color($pink, 60%),
92
+ "pink-300": tint-color($pink, 40%),
93
+ "pink-400": tint-color($pink, 20%),
94
+ "pink-500": $pink,
95
+ "pink-600": shade-color($pink, 20%),
96
+ "pink-700": shade-color($pink, 40%),
97
+ "pink-800": shade-color($pink, 60%),
98
+ "pink-900": shade-color($pink, 80%),
99
+
100
+ "red-100": tint-color($red, 80%),
101
+ "red-200": tint-color($red, 60%),
102
+ "red-300": tint-color($red, 40%),
103
+ "red-400": tint-color($red, 20%),
104
+ "red-500": $red,
105
+ "red-600": shade-color($red, 20%),
106
+ "red-700": shade-color($red, 40%),
107
+ "red-800": shade-color($red, 60%),
108
+ "red-900": shade-color($red, 80%),
109
+
110
+ "orange-100": tint-color($orange, 80%),
111
+ "orange-200": tint-color($orange, 60%),
112
+ "orange-300": tint-color($orange, 40%),
113
+ "orange-400": tint-color($orange, 20%),
114
+ "orange-500": $orange,
115
+ "orange-600": shade-color($orange, 20%),
116
+ "orange-700": shade-color($orange, 40%),
117
+ "orange-800": shade-color($orange, 60%),
118
+ "orange-900": shade-color($orange, 80%),
119
+
120
+ "yellow-100": tint-color($yellow, 80%),
121
+ "yellow-200": tint-color($yellow, 60%),
122
+ "yellow-300": tint-color($yellow, 40%),
123
+ "yellow-400": tint-color($yellow, 20%),
124
+ "yellow-500": $yellow,
125
+ "yellow-600": shade-color($yellow, 20%),
126
+ "yellow-700": shade-color($yellow, 40%),
127
+ "yellow-800": shade-color($yellow, 60%),
128
+ "yellow-900": shade-color($yellow, 80%),
129
+
130
+ "green-100": tint-color($green, 80%),
131
+ "green-200": tint-color($green, 60%),
132
+ "green-300": tint-color($green, 40%),
133
+ "green-400": tint-color($green, 20%),
134
+ "green-500": $green,
135
+ "green-600": shade-color($green, 20%),
136
+ "green-700": shade-color($green, 40%),
137
+ "green-800": shade-color($green, 60%),
138
+ "green-900": shade-color($green, 80%),
139
+
140
+ "teal-100": tint-color($teal, 80%),
141
+ "teal-200": tint-color($teal, 60%),
142
+ "teal-300": tint-color($teal, 40%),
143
+ "teal-400": tint-color($teal, 20%),
144
+ "teal-500": $teal,
145
+ "teal-600": shade-color($teal, 20%),
146
+ "teal-700": shade-color($teal, 40%),
147
+ "teal-800": shade-color($teal, 60%),
148
+ "teal-900": shade-color($teal, 80%),
149
+
150
+ "cyan-100": tint-color($cyan, 80%),
151
+ "cyan-200": tint-color($cyan, 60%),
152
+ "cyan-300": tint-color($cyan, 40%),
153
+ "cyan-400": tint-color($cyan, 20%),
154
+ "cyan-500": $cyan,
155
+ "cyan-600": shade-color($cyan, 20%),
156
+ "cyan-700": shade-color($cyan, 40%),
157
+ "cyan-800": shade-color($cyan, 60%),
158
+ "cyan-900": shade-color($cyan, 80%),
159
+ ) !default;
160
+
161
+ $all-colors: map-merge($theme-colors, $palette-colors);
@@ -0,0 +1,29 @@
1
+ @mixin color-contrast($color) {
2
+ $r: red($color);
3
+ $g: green($color);
4
+ $b: blue($color);
5
+
6
+ $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
7
+
8
+ @if ($yiq >= 150) {
9
+ color: #111111;
10
+ } @else {
11
+ color: $white;
12
+ }
13
+ }
14
+
15
+ @function tint-color($color, $level) {
16
+ @return mix(white, $color, $level);
17
+ }
18
+
19
+ @function shade-color($color, $level) {
20
+ @return mix(black, $color, $level);
21
+ }
22
+
23
+ @function strip-unit($number) {
24
+ @if type-of($number) == 'number' and not unitless($number) {
25
+ @return $number / ($number * 0 + 1);
26
+ }
27
+
28
+ @return $number;
29
+ }
@@ -0,0 +1,21 @@
1
+ @mixin padding-group($prefix, $size, $value) {
2
+ @include padding-util('.p-#{$prefix}#{$size}') {
3
+ padding: $value;
4
+ }
5
+
6
+ @include padding-util('.pt-#{$prefix}#{$size}, .py-#{$prefix}#{$size}') {
7
+ padding-top: $value;
8
+ }
9
+
10
+ @include padding-util('.pr-#{$prefix}#{$size}, .px-#{$prefix}#{$size}') {
11
+ padding-right: $value;
12
+ }
13
+
14
+ @include padding-util('.pb-#{$prefix}#{$size}, .py-#{$prefix}#{$size}') {
15
+ padding-bottom: $value;
16
+ }
17
+
18
+ @include padding-util('.pl-#{$prefix}#{$size}, .px-#{$prefix}#{$size}') {
19
+ padding-left: $value;
20
+ }
21
+ }
@@ -1,7 +1,7 @@
1
- /* Based on https://templates.mailchimp.com/development/css/reset-styles/ by Mailchimp */
1
+ // Based on https://templates.mailchimp.com/development/css/reset-styles/ by Mailchimp
2
2
  body, .body {
3
3
  margin: 0;
4
- Margin: 0; // For compatibility with Outlook https://www.emailonacid.com/blog/article/email-development/outlook-com-does-support-margins/
4
+ Margin: 0; // For compatibility with Outlook
5
5
  padding: 0;
6
6
  border: 0;
7
7
  outline: 0;
@@ -27,26 +27,7 @@ img {
27
27
  line-height: 100%;
28
28
  outline: none;
29
29
  text-decoration: none;
30
- }
31
-
32
- a img {
33
- border: 0 none;
34
- }
35
-
36
- // don't apply to spacers
37
- table:not([class^=s-]) {
38
- font-family: $font-family-base;
39
- mso-table-lspace: 0pt;
40
- mso-table-rspace: 0pt;
41
- }
42
-
43
- table:not([class^=s-]) {
44
- border-spacing: 0px;
45
- border-collapse: collapse;
46
- td {
47
- border-spacing: 0px;
48
- border-collapse: collapse;
49
- }
30
+ display: block;
50
31
  }
51
32
 
52
33
  // to fix centering in yahoo
@@ -62,3 +43,7 @@ p {
62
43
  font-size: $font-size-base;
63
44
  margin: 0;
64
45
  }
46
+
47
+ a {
48
+ color: $link-color;
49
+ }