mjml-rb 0.2.7 → 0.2.8
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.
- checksums.yaml +4 -4
- data/lib/mjml-rb/components/image.rb +16 -9
- data/lib/mjml-rb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6cd1e0e7d201fa71910c7ecf5aa470f2053a948bae4b08f004bc44398f30155
|
|
4
|
+
data.tar.gz: 36a71f158c1ad304f53352e2b4657f2b2e253471edd4011b7e8270eca6895e73
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 04bb951bdcebff861f813ee50fe54015510061a7ed83d3f563e5404eaa0128796450cf2b3bfa8943d4916b9fae4a33d2d33236b31be90156033f8be7c9074940
|
|
7
|
+
data.tar.gz: 312d94578cb0e649335e85cd73eaf8bcdd3ad93163cdda32917a572ebcff3dc1adee2d36f9956969b1eec959b89919708ac5aa6eaf1371bc500e5899e766ace2
|
|
@@ -15,19 +15,19 @@ module MjmlRb
|
|
|
15
15
|
"font-size" => "13px"
|
|
16
16
|
}.freeze
|
|
17
17
|
|
|
18
|
-
HEAD_STYLE = <<~CSS.freeze
|
|
19
|
-
@media only screen and (max-width:480px) {
|
|
20
|
-
table.mj-full-width-mobile { width: 100% !important; }
|
|
21
|
-
td.mj-full-width-mobile { width: auto !important; }
|
|
22
|
-
}
|
|
23
|
-
CSS
|
|
24
|
-
|
|
25
18
|
def tags
|
|
26
19
|
TAGS
|
|
27
20
|
end
|
|
28
21
|
|
|
29
|
-
def head_style
|
|
30
|
-
|
|
22
|
+
def head_style(breakpoint)
|
|
23
|
+
lower_breakpoint = make_lower_breakpoint(breakpoint)
|
|
24
|
+
|
|
25
|
+
<<~CSS
|
|
26
|
+
@media only screen and (max-width:#{lower_breakpoint}) {
|
|
27
|
+
table.mj-full-width-mobile { width: 100% !important; }
|
|
28
|
+
td.mj-full-width-mobile { width: auto !important; }
|
|
29
|
+
}
|
|
30
|
+
CSS
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def head_style_tags
|
|
@@ -178,6 +178,13 @@ module MjmlRb
|
|
|
178
178
|
else "0"
|
|
179
179
|
end
|
|
180
180
|
end
|
|
181
|
+
|
|
182
|
+
def make_lower_breakpoint(breakpoint)
|
|
183
|
+
matched = breakpoint.to_s.match(/[0-9]+/)
|
|
184
|
+
return breakpoint if matched.nil?
|
|
185
|
+
|
|
186
|
+
"#{matched[0].to_i - 1}px"
|
|
187
|
+
end
|
|
181
188
|
end
|
|
182
189
|
end
|
|
183
190
|
end
|
data/lib/mjml-rb/version.rb
CHANGED