bootstrap-email 0.3.3 → 1.0.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/bootstrap-email +2 -0
- data/core/bootstrap-email.scss +29 -18
- data/core/bootstrap-head.scss +143 -0
- data/core/layout.html.erb +11 -0
- data/core/scss/_colors.scss +161 -0
- data/core/scss/_functions.scss +29 -0
- data/core/scss/_helper_groups.scss +21 -0
- data/core/{sass → scss}/_reboot_email.scss +7 -22
- data/core/scss/_selectors_for_utils.scss +124 -0
- data/core/scss/_utilities.scss +145 -0
- data/core/scss/_variables.scss +52 -0
- data/core/{sass → scss/components}/_alert.scss +0 -1
- data/core/{sass → scss/components}/_badge.scss +8 -15
- data/core/{sass → scss/components}/_button.scss +21 -17
- data/core/{sass → scss/components}/_card.scss +3 -2
- data/core/{sass → scss/components}/_container.scss +0 -0
- data/core/scss/components/_grid.scss +38 -0
- data/core/scss/components/_hr.scss +8 -0
- data/core/{sass → scss/components}/_image.scss +2 -1
- data/core/{sass → scss/components}/_preview.scss +0 -0
- data/core/scss/components/_stack.scss +33 -0
- data/core/{sass → scss/components}/_table.scss +0 -0
- data/core/scss/utilities/_background.scss +5 -0
- data/core/scss/utilities/_border-radius.scss +21 -0
- data/core/scss/utilities/_border.scss +13 -0
- data/core/scss/utilities/_color.scss +9 -0
- data/core/scss/utilities/_display.scss +7 -0
- data/core/scss/utilities/_sizing.scss +31 -0
- data/core/scss/utilities/_spacing.scss +18 -0
- data/core/scss/utilities/_text-decoration.scss +9 -0
- data/core/scss/utilities/_typography.scss +48 -0
- data/core/scss/utilities/_valign.scss +5 -0
- data/core/templates/body.html.erb +1 -1
- data/core/templates/container.html.erb +3 -3
- data/core/templates/table-left.html.erb +1 -1
- data/core/templates/table-to-tbody.html.erb +5 -0
- data/core/templates/table-to-tr.html.erb +7 -0
- data/core/templates/table.html.erb +1 -1
- data/core/templates/td.html.erb +3 -0
- data/core/templates/tr.html.erb +5 -0
- data/lib/bootstrap-email.rb +20 -222
- data/lib/bootstrap-email/bootstrap_email_cli.rb +92 -0
- data/lib/bootstrap-email/compiler.rb +98 -0
- data/lib/bootstrap-email/components/alert.rb +11 -0
- data/lib/bootstrap-email/components/align.rb +22 -0
- data/lib/bootstrap-email/components/badge.rb +11 -0
- data/lib/bootstrap-email/components/base.rb +54 -0
- data/lib/bootstrap-email/components/block.rb +13 -0
- data/lib/bootstrap-email/components/body.rb +10 -0
- data/lib/bootstrap-email/components/button.rb +11 -0
- data/lib/bootstrap-email/components/card.rb +14 -0
- data/lib/bootstrap-email/components/color.rb +13 -0
- data/lib/bootstrap-email/components/container.rb +14 -0
- data/lib/bootstrap-email/components/force_encoding.rb +16 -0
- data/lib/bootstrap-email/components/grid.rb +14 -0
- data/lib/bootstrap-email/components/head_style.rb +33 -0
- data/lib/bootstrap-email/components/hr.rb +12 -0
- data/lib/bootstrap-email/components/margin.rb +22 -0
- data/lib/bootstrap-email/components/padding.rb +16 -0
- data/lib/bootstrap-email/components/paragraph.rb +13 -0
- data/lib/bootstrap-email/components/preview_text.rb +18 -0
- data/lib/bootstrap-email/components/spacer.rb +11 -0
- data/lib/bootstrap-email/components/spacing.rb +17 -0
- data/lib/bootstrap-email/components/stack.rb +30 -0
- data/lib/bootstrap-email/components/table.rb +13 -0
- data/lib/bootstrap-email/components/version_comment.rb +15 -0
- data/lib/bootstrap-email/erb.rb +9 -0
- data/lib/bootstrap-email/initialize.rb +1 -0
- data/lib/bootstrap-email/rails/action_mailer.rb +11 -0
- data/lib/bootstrap-email/{engine.rb → rails/engine.rb} +0 -0
- data/lib/bootstrap-email/sass_cache.rb +67 -0
- data/lib/bootstrap-email/version.rb +3 -5
- metadata +82 -59
- data/core/head.scss +0 -269
- data/core/sass/_border.scss +0 -73
- data/core/sass/_color.scss +0 -33
- data/core/sass/_display.scss +0 -7
- data/core/sass/_functions.scss +0 -14
- data/core/sass/_grid.scss +0 -131
- data/core/sass/_hr.scss +0 -13
- data/core/sass/_spacing.scss +0 -100
- data/core/sass/_typography.scss +0 -50
- data/core/sass/_variables.scss +0 -150
- data/core/template.html.erb +0 -11
- data/core/templates/align-center.html.erb +0 -9
- data/core/templates/align-left.html.erb +0 -9
- data/core/templates/align-right.html.erb +0 -9
- data/core/templates/col.html.erb +0 -3
- data/core/templates/hr.html.erb +0 -9
- data/core/templates/row.html.erb +0 -7
- data/lib/assets/stylesheets/bootstrap-email.scss +0 -1
- data/lib/bootstrap-email/action_mailer.rb +0 -12
- data/lib/bootstrap-email/premailer_railtie.rb +0 -5
@@ -0,0 +1,124 @@
|
|
1
|
+
//
|
2
|
+
// Background color
|
3
|
+
//
|
4
|
+
@mixin background-color-util($class) {
|
5
|
+
#{$class} {
|
6
|
+
&,
|
7
|
+
& > tbody > tr > td {
|
8
|
+
@content
|
9
|
+
}
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
//
|
14
|
+
// Color
|
15
|
+
//
|
16
|
+
@mixin color-util($class) {
|
17
|
+
#{$class} {
|
18
|
+
&,
|
19
|
+
& > tbody > tr > td,
|
20
|
+
&.btn td a {
|
21
|
+
@content
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
//
|
27
|
+
// Border radius
|
28
|
+
//
|
29
|
+
@mixin border-radius-util($class) {
|
30
|
+
#{$class} {
|
31
|
+
&,
|
32
|
+
& > tbody > tr > td,
|
33
|
+
&.btn td,
|
34
|
+
&.btn td a {
|
35
|
+
@content
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
//
|
41
|
+
// Border color
|
42
|
+
//
|
43
|
+
@mixin border-color-util($class) {
|
44
|
+
#{$class} {
|
45
|
+
&,
|
46
|
+
&.btn td a,
|
47
|
+
&.hr td {
|
48
|
+
@content
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
//
|
54
|
+
// Sizing (width & height)
|
55
|
+
//
|
56
|
+
@mixin sizing-util($class) {
|
57
|
+
#{$class} {
|
58
|
+
&,
|
59
|
+
& > tbody > tr > td {
|
60
|
+
@content
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
//
|
66
|
+
// Padding
|
67
|
+
//
|
68
|
+
@mixin padding-util($class) {
|
69
|
+
#{$class} {
|
70
|
+
&:not(table),
|
71
|
+
&:not(.btn) > tbody > tr > td,
|
72
|
+
&.btn td a {
|
73
|
+
@content
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
//
|
79
|
+
// Spacer
|
80
|
+
//
|
81
|
+
@mixin spacer-util($class) {
|
82
|
+
#{$class} {
|
83
|
+
& > tbody > tr > td {
|
84
|
+
@content
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
//
|
90
|
+
// Font weight
|
91
|
+
//
|
92
|
+
@mixin font-weight-util($class) {
|
93
|
+
#{$class} {
|
94
|
+
&,
|
95
|
+
& > tbody > tr > td,
|
96
|
+
&.btn td a {
|
97
|
+
@content
|
98
|
+
}
|
99
|
+
}
|
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
|
+
}
|
@@ -0,0 +1,145 @@
|
|
1
|
+
$breakpoints: ('', 'lg-');
|
2
|
+
|
3
|
+
$headings: (
|
4
|
+
1: 2.25 * $font-size-base,
|
5
|
+
2: 2 * $font-size-base,
|
6
|
+
3: 1.75 * $font-size-base,
|
7
|
+
4: 1.5 * $font-size-base,
|
8
|
+
5: 1.25 * $font-size-base,
|
9
|
+
6: 1 * $font-size-base
|
10
|
+
) !default;
|
11
|
+
|
12
|
+
$font-size: (
|
13
|
+
'xs': 0.75 * $font-size-base,
|
14
|
+
'sm': 0.875 * $font-size-base,
|
15
|
+
'base': 1 * $font-size-base,
|
16
|
+
'lg': 1.125 * $font-size-base,
|
17
|
+
'xl': 1.25 * $font-size-base,
|
18
|
+
'2xl': 1.5 * $font-size-base,
|
19
|
+
'3xl': 1.875 * $font-size-base,
|
20
|
+
'4xl': 2.25 * $font-size-base,
|
21
|
+
'5xl': 3 * $font-size-base,
|
22
|
+
'6xl': 4 * $font-size-base,
|
23
|
+
'7xl': 5 * $font-size-base
|
24
|
+
) !default;
|
25
|
+
|
26
|
+
$line-height: (
|
27
|
+
1: 1,
|
28
|
+
'sm': 1.25,
|
29
|
+
'base': 1.5,
|
30
|
+
'lg': 2
|
31
|
+
) !default;
|
32
|
+
|
33
|
+
$size-scale: 4px;
|
34
|
+
$spacers: (
|
35
|
+
0: 0,
|
36
|
+
1: 1 * $size-scale,
|
37
|
+
2: 2 * $size-scale,
|
38
|
+
3: 3 * $size-scale,
|
39
|
+
4: 4 * $size-scale,
|
40
|
+
5: 5 * $size-scale,
|
41
|
+
6: 6 * $size-scale,
|
42
|
+
7: 7 * $size-scale,
|
43
|
+
8: 8 * $size-scale,
|
44
|
+
9: 9 * $size-scale,
|
45
|
+
10: 10 * $size-scale,
|
46
|
+
12: 12 * $size-scale,
|
47
|
+
16: 16 * $size-scale,
|
48
|
+
20: 20 * $size-scale,
|
49
|
+
24: 24 * $size-scale,
|
50
|
+
32: 32 * $size-scale,
|
51
|
+
40: 40 * $size-scale
|
52
|
+
) !default;
|
53
|
+
|
54
|
+
$sizing: (
|
55
|
+
0: 0,
|
56
|
+
1: 1 * $size-scale,
|
57
|
+
2: 2 * $size-scale,
|
58
|
+
3: 3 * $size-scale,
|
59
|
+
4: 4 * $size-scale,
|
60
|
+
5: 5 * $size-scale,
|
61
|
+
6: 6 * $size-scale,
|
62
|
+
7: 7 * $size-scale,
|
63
|
+
8: 8 * $size-scale,
|
64
|
+
9: 9 * $size-scale,
|
65
|
+
10: 10 * $size-scale,
|
66
|
+
12: 12 * $size-scale,
|
67
|
+
16: 16 * $size-scale,
|
68
|
+
20: 20 * $size-scale,
|
69
|
+
24: 24 * $size-scale,
|
70
|
+
32: 32 * $size-scale,
|
71
|
+
40: 40 * $size-scale,
|
72
|
+
48: 48 * $size-scale,
|
73
|
+
56: 56 * $size-scale,
|
74
|
+
64: 64 * $size-scale,
|
75
|
+
80: 80 * $size-scale,
|
76
|
+
96: 96 * $size-scale,
|
77
|
+
112: 112 * $size-scale,
|
78
|
+
128: 128 * $size-scale,
|
79
|
+
144: 144 * $size-scale,
|
80
|
+
150: 150 * $size-scale
|
81
|
+
) !default;
|
82
|
+
$sizing-types: (
|
83
|
+
'w': 'width',
|
84
|
+
'h': 'height'
|
85
|
+
);
|
86
|
+
|
87
|
+
$grid-cols: (
|
88
|
+
1: 8.333333%,
|
89
|
+
2: 16.666667%,
|
90
|
+
3: 25%,
|
91
|
+
4: 33.333333%,
|
92
|
+
5: 41.666667%,
|
93
|
+
6: 50%,
|
94
|
+
7: 58.333333%,
|
95
|
+
8: 66.666667%,
|
96
|
+
9: 75%,
|
97
|
+
10: 83.333333%,
|
98
|
+
11: 91.666667%,
|
99
|
+
12: 100%
|
100
|
+
);
|
101
|
+
|
102
|
+
$display-type: (
|
103
|
+
inline,
|
104
|
+
inline-block,
|
105
|
+
block,
|
106
|
+
table,
|
107
|
+
none
|
108
|
+
) !default;
|
109
|
+
|
110
|
+
$border-widths: (
|
111
|
+
'': 1px,
|
112
|
+
'-2': 2px,
|
113
|
+
'-3': 3px,
|
114
|
+
'-4': 4px,
|
115
|
+
'-5': 5px,
|
116
|
+
'-0': 0px
|
117
|
+
) !default;
|
118
|
+
|
119
|
+
$border-radiuses: (
|
120
|
+
'-none': 0px,
|
121
|
+
'-sm': 2px,
|
122
|
+
'': 4px,
|
123
|
+
'-md': 6px,
|
124
|
+
'-lg': 8px,
|
125
|
+
'-xl': 12px,
|
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
|
145
|
+
) !default;
|
@@ -0,0 +1,52 @@
|
|
1
|
+
$font-size-base: 16px !default;
|
2
|
+
$font-weight-base: normal !default;
|
3
|
+
$font-family-sans-serif: Helvetica, Arial, sans-serif !default;
|
4
|
+
$font-family-base: $font-family-sans-serif !default;
|
5
|
+
$border-width: 1px !default;
|
6
|
+
$line-height-base: 1.5 !default;
|
7
|
+
$headings-line-height: 1.2 !default;
|
8
|
+
$headings-margin-top: 0 !default;
|
9
|
+
$headings-margin-bottom: 0 !default;
|
10
|
+
$headings-font-family: null !default;
|
11
|
+
$headings-font-weight: 500 !default;
|
12
|
+
$headings-color: null !default;
|
13
|
+
|
14
|
+
$border-color: $gray-300 !default;
|
15
|
+
|
16
|
+
$border-radius-sm: 3px !default;
|
17
|
+
$border-radius: 6px !default;
|
18
|
+
$border-radius-lg: 9px !default;
|
19
|
+
$border-radius-xl: 12px !default;
|
20
|
+
$border-radius-pill: 9999px !default;
|
21
|
+
|
22
|
+
$table-accent-bg: #f2f2f2 !default;
|
23
|
+
$table-background-color: null !default;
|
24
|
+
$table-border-color: $border-color !default;
|
25
|
+
$table-border-width: $border-width !default;
|
26
|
+
|
27
|
+
$body-color: $black !default;
|
28
|
+
$body-bg: $white !default;
|
29
|
+
|
30
|
+
$btn-padding-y: 8px !default;
|
31
|
+
$btn-padding-x: 12px !default;
|
32
|
+
$btn-font-family: $font-family-base !default;
|
33
|
+
$btn-font-size: $font-size-base !default;
|
34
|
+
$btn-line-height: 1.25 * $btn-font-size !default;
|
35
|
+
|
36
|
+
$btn-padding-y-sm: 0.25 * $btn-font-size !default;
|
37
|
+
$btn-padding-x-sm: 0.5 * $btn-font-size !default;
|
38
|
+
$btn-font-size-sm: 0.875 * $btn-font-size !default;
|
39
|
+
$btn-line-height-sm: $btn-line-height * 0.875 !default;
|
40
|
+
|
41
|
+
$btn-padding-y-lg: 0.5 * $btn-font-size !default;
|
42
|
+
$btn-padding-x-lg: $btn-font-size !default;
|
43
|
+
$btn-font-size-lg: 1.25 * $btn-font-size !default;
|
44
|
+
$btn-line-height-lg: $btn-line-height * 1.25 !default;
|
45
|
+
|
46
|
+
$btn-border-width: $border-width !default;
|
47
|
+
$btn-font-weight: $font-weight-base !default;
|
48
|
+
$btn-border-radius: $border-radius !default;
|
49
|
+
$btn-border-radius-lg: $border-radius-lg !default;
|
50
|
+
$btn-border-radius-sm: $border-radius-sm !default;
|
51
|
+
|
52
|
+
$link-color: $primary !default;
|
@@ -14,43 +14,36 @@
|
|
14
14
|
.badge-pill > tbody > tr > td {
|
15
15
|
padding-right: .6 * $font-size-base;
|
16
16
|
padding-left: .6 * $font-size-base;
|
17
|
-
border-radius:
|
17
|
+
border-radius: $border-radius-pill;
|
18
18
|
}
|
19
19
|
|
20
|
-
//
|
21
|
-
|
22
|
-
.badge-#{$color} > tbody > tr > td{
|
23
|
-
@include color-yiq($value);
|
24
|
-
background-color: $value;
|
25
|
-
}
|
26
|
-
}
|
27
|
-
|
28
|
-
h1{
|
20
|
+
// Make badge text 75% smaller when in a header
|
21
|
+
h1 {
|
29
22
|
.badge > tbody > tr > td {
|
30
23
|
font-size: .75 * 2.25 * $font-size-base;
|
31
24
|
}
|
32
25
|
}
|
33
|
-
h2{
|
26
|
+
h2 {
|
34
27
|
.badge > tbody > tr > td {
|
35
28
|
font-size: .75 * 2 * $font-size-base;
|
36
29
|
}
|
37
30
|
}
|
38
|
-
h3{
|
31
|
+
h3 {
|
39
32
|
.badge > tbody > tr > td {
|
40
33
|
font-size: .75 * 1.75 * $font-size-base;
|
41
34
|
}
|
42
35
|
}
|
43
|
-
h4{
|
36
|
+
h4 {
|
44
37
|
.badge > tbody > tr > td {
|
45
38
|
font-size: .75 * 1.5 * $font-size-base;
|
46
39
|
}
|
47
40
|
}
|
48
|
-
h5{
|
41
|
+
h5 {
|
49
42
|
.badge > tbody > tr > td {
|
50
43
|
font-size: .75 * 1.25 * $font-size-base;
|
51
44
|
}
|
52
45
|
}
|
53
|
-
h6{
|
46
|
+
h6 {
|
54
47
|
.badge > tbody > tr > td {
|
55
48
|
font-size: .75 * $font-size-base;
|
56
49
|
}
|
@@ -21,26 +21,30 @@
|
|
21
21
|
white-space: nowrap;
|
22
22
|
}
|
23
23
|
|
24
|
-
@each $
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
24
|
+
@each $name, $color in $all-colors {
|
25
|
+
@if $name != "transparent" {
|
26
|
+
.btn-#{$name} td {
|
27
|
+
background-color: $color;
|
28
|
+
}
|
29
|
+
.btn-#{$name} td a {
|
30
|
+
background-color: $color;
|
31
|
+
@include color-contrast($color);
|
32
|
+
border-color: $color;
|
33
|
+
}
|
32
34
|
}
|
33
35
|
}
|
34
36
|
|
35
|
-
@each $
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
37
|
+
@each $name, $color in $all-colors {
|
38
|
+
@if $name != "transparent" {
|
39
|
+
.btn-outline-#{$name} td {
|
40
|
+
background-color: transparent;
|
41
|
+
border-color: $color;
|
42
|
+
}
|
43
|
+
.btn-outline-#{$name} td a {
|
44
|
+
background-color: transparent;
|
45
|
+
border-color: $color;
|
46
|
+
color: $color;
|
47
|
+
}
|
44
48
|
}
|
45
49
|
}
|
46
50
|
|
@@ -1,11 +1,12 @@
|
|
1
1
|
.card {
|
2
2
|
background-color: $white;
|
3
|
-
border-radius: $
|
4
|
-
border: 1px solid $
|
3
|
+
border-radius: $border-radius;
|
4
|
+
border: 1px solid $border-color;
|
5
5
|
border-collapse: separate !important;
|
6
6
|
width: 100%;
|
7
7
|
overflow: hidden;
|
8
8
|
& > tbody > tr > td {
|
9
|
+
background-color: $white;
|
9
10
|
width: 100%;
|
10
11
|
}
|
11
12
|
.card-body {
|