bootstrap-email 1.4.1 → 1.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7da7e0b649969d555aa28a146b4dacbae0e92cfb5583cf3a21605cf95a0f6864
4
- data.tar.gz: 31483dce9db95acafaed1893f5cc16dd483143dc7400929ba3752fc5b39d5c03
3
+ metadata.gz: ac25ab6a2479ffc33911f99f6c3400e0afb91281fc8013e727ca7335645a7b4b
4
+ data.tar.gz: f48b25b611e814365ab86d961b9f8182e927bbe8132505e7b83dfcac2e4585cd
5
5
  SHA512:
6
- metadata.gz: 16f28e567dc36b6c34e304e9726d24606a01780b033a1d78d843b8e0d5112507e0902ecc95f9a379ebc390c6c4007894173bb307e662d56ad0c1f72c2895015d
7
- data.tar.gz: e7e93ae7273e656d958bad0869f3fe951384f073156c3832277c65539d0d568ebc53dd3c97bbd6acf5e0367ab00eb71a2bf384a4789bee37e66a9ee2710f69f9
6
+ metadata.gz: fa8ed9754a63d81aac1d19e1457901748ab7ab178e1d211128406f5dba104dc2029e8d6762f444089c3d8ff4ef3213796be2273c1b541a0bddb83346ad662a24
7
+ data.tar.gz: d8864700d3af61fce5b1da58dbe2fe5451173e0e5c311f223caf9620fd5eea6bbfe6a4d65d354fd04990196d095b57bf741ec123efa46ee005703768941ed356
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.1
1
+ 1.5.0
@@ -10,6 +10,17 @@
10
10
  border-radius: 4px;
11
11
  }
12
12
 
13
+ @each $name, $theme in $btn-themes {
14
+ .badge-#{$name} td {
15
+ background-color: map-get($theme, "background-color");
16
+ }
17
+ .badge-#{$name} td span {
18
+ background-color: map-get($theme, "background-color");
19
+ color: map-get($theme, "color");
20
+ border-color: map-get($theme, "border-color");
21
+ }
22
+ }
23
+
13
24
  // Pill badges
14
25
  .badge-pill > tbody > tr > td {
15
26
  padding-right: .6 * $font-size-base;
@@ -1,9 +1,11 @@
1
+ @use "sass:math";
2
+
1
3
  @function color-contrast($color) {
2
4
  $r: red($color);
3
5
  $g: green($color);
4
6
  $b: blue($color);
5
7
 
6
- $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
8
+ $yiq: math.div((($r * 299) + ($g * 587) + ($b * 114)), 1000);
7
9
 
8
10
  @if ($yiq >= 150) {
9
11
  @return #111111;
@@ -22,7 +24,7 @@
22
24
 
23
25
  @function strip-unit($number) {
24
26
  @if type-of($number) == 'number' and not unitless($number) {
25
- @return $number / ($number * 0 + 1);
27
+ @return math.div($number, ($number * 0 + 1));
26
28
  }
27
29
 
28
30
  @return $number;
@@ -4,7 +4,9 @@
4
4
  @mixin background-color-util($class) {
5
5
  #{$class} {
6
6
  &,
7
- & > tbody > tr > td {
7
+ & > tbody > tr > td,
8
+ &.btn td a,
9
+ &.badge td {
8
10
  @content
9
11
  }
10
12
  }
@@ -17,7 +19,8 @@
17
19
  #{$class} {
18
20
  &,
19
21
  & > tbody > tr > td,
20
- &.btn td a {
22
+ &.btn td a,
23
+ &.badge td {
21
24
  @content
22
25
  }
23
26
  }
@@ -31,7 +34,8 @@
31
34
  &,
32
35
  & > tbody > tr > td,
33
36
  &.btn td,
34
- &.btn td a {
37
+ &.btn td a,
38
+ &.badge td {
35
39
  @content
36
40
  }
37
41
  }
@@ -14,7 +14,6 @@ module BootstrapEmail
14
14
  html = File.read(input)
15
15
  end
16
16
  html = add_layout(html)
17
- sass_load_paths
18
17
  build_premailer_doc(html)
19
18
  end
20
19
 
@@ -51,10 +50,6 @@ module BootstrapEmail
51
50
  )
52
51
  end
53
52
 
54
- def sass_load_paths
55
- SassC.load_paths << config.sass_load_paths
56
- end
57
-
58
53
  def build_premailer_doc(html)
59
54
  css_string = BootstrapEmail::SassCache.compile('bootstrap-email', config, style: :expanded)
60
55
  self.premailer = Premailer.new(
@@ -29,9 +29,9 @@ module BootstrapEmail
29
29
  end
30
30
 
31
31
  def sass_load_paths
32
- paths_array = [SassCache::SASS_DIR]
33
- custom_load_paths = config_for_option(:sass_load_paths) || []
34
- paths_array.concat(custom_load_paths)
32
+ library_paths = [SassCache::SASS_DIR]
33
+ user_paths = config_for_option(:sass_load_paths) || []
34
+ library_paths + user_paths
35
35
  end
36
36
 
37
37
  def sass_cache_location
@@ -24,11 +24,11 @@ module BootstrapEmail
24
24
  end
25
25
 
26
26
  def self.opening_regex
27
- opening_regex = OPEN_BRACKETS.map { |bracket| Regexp.quote(bracket) }.join('|')
27
+ OPEN_BRACKETS.map { |bracket| Regexp.quote(bracket) }.join('|')
28
28
  end
29
29
 
30
30
  def self.closing_regex
31
- closing_regex = CLOSE_BRACKETS.map { |bracket| Regexp.quote(bracket) }.join('|')
31
+ CLOSE_BRACKETS.map { |bracket| Regexp.quote(bracket) }.join('|')
32
32
  end
33
33
  end
34
34
  end
@@ -63,11 +63,18 @@ module BootstrapEmail
63
63
  end
64
64
 
65
65
  def compile_and_cache_scss(cache_path)
66
- file = sass_config || File.read("#{file_path}.scss")
67
- css = SassC::Engine.new(file, style: style).render
66
+ css = compile_css
68
67
  File.write(cache_path, css)
69
68
  puts "New css file cached for #{type}" if config.sass_log_enabled?
70
69
  css
71
70
  end
71
+
72
+ def compile_css
73
+ if sass_config
74
+ Sass.compile_string(sass_config, load_paths: config.sass_load_paths, style: style).css
75
+ else
76
+ Sass.compile("#{file_path}.scss", load_paths: config.sass_load_paths, style: style).css
77
+ end
78
+ end
72
79
  end
73
80
  end
@@ -4,7 +4,7 @@ require 'nokogiri'
4
4
  require 'erb'
5
5
  require 'ostruct'
6
6
  require 'premailer'
7
- require 'sassc'
7
+ require 'sass-embedded'
8
8
  require 'digest/sha1'
9
9
  require 'css_parser'
10
10
  require 'fileutils'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-email
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Yamartino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-08 00:00:00.000000000 Z
11
+ date: 2024-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlbeautifier
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.7'
55
55
  - !ruby/object:Gem::Dependency
56
- name: sassc
56
+ name: sass-embedded
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.1'
61
+ version: '1.63'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.1'
68
+ version: '1.63'
69
69
  description:
70
70
  email: stu@stuyam.com
71
71
  executables:
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  - !ruby/object:Gem::Version
182
182
  version: '0'
183
183
  requirements: []
184
- rubygems_version: 3.1.6
184
+ rubygems_version: 3.2.3
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: 'Bootstrap 5+ stylesheet, compiler, and inliner for responsive and consistent