svg_sprite 1.0.1 → 1.0.2

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: dad974718ab6a4417495499e8aa788e041663a5f11819611e651a2c05bd378da
4
- data.tar.gz: e77c32dce5a61f03ddc881f9a3e01895ee79fa7447a3ad2dd770cb39be468a6f
3
+ metadata.gz: fe18c6c07ac1ce4d61936ca9aeed70d8de0b8d1803ab87efd7b85638213aa226
4
+ data.tar.gz: 1d04666e8320452af0979288eaf388a6b767e564e7659ea9af68096f4fcdb918
5
5
  SHA512:
6
- metadata.gz: 37b27b2ab2af3ec6a728eee52e636e446eae3a38b1672e853bb72d70c631a6f52bccdf10c94a70a85f0bc6bb15a266a8c0818bcc240c2b6a56037d9443684c71
7
- data.tar.gz: 44b8b4bc240067b9e5ee979ecd27f320c83bfbf9a3539e67c2ecee6d3593a6560bed125968118295a6f7cbd7d37762e302af180fe990d0fe7775ae686e65d0b7
6
+ metadata.gz: e15b6117c8a07d0e7746e21bcddf985ea27cbac7780e678c9e50b6f48236d918c695c0f5f400bf52b3f1730c5f500f9ef09bf3939f8a1f3e3df11aee4c7b3a82
7
+ data.tar.gz: 7c2bc3ce04d93443b1f21b29778a04f3b0aca1eb5479d7ee241c92bb2ee71391149a79670a063b1394296fbb1246929712750e3ad4eb0a57974f9346f6796bac
data/CHANGELOG.md CHANGED
@@ -11,6 +11,12 @@ Prefix your message with one of the following:
11
11
  - [Security] in case of vulnerabilities.
12
12
  -->
13
13
 
14
+ ## v1.0.2
15
+
16
+ - [Changed] Remove `<symbol>`'s `width` and `height` property, otherwise Google
17
+ Chrome and Firefox won't be able to resize the SVG properly. The `viewBox`
18
+ will determine the svg's dimensions.
19
+
14
20
  ## v1.0.1
15
21
 
16
22
  - [Changed] SVG sprite now includes the sprite name as the id. It means you'll
@@ -12,10 +12,16 @@ class SvgSprite
12
12
  @fill = fill
13
13
  end
14
14
 
15
+ def svg
16
+ @svg ||= xml.css("svg").first
17
+ end
18
+
15
19
  def symbol
16
- @symbol ||= xml.css("svg").first.clone.tap do |node|
20
+ @symbol ||= svg.clone.tap do |node|
17
21
  node.name = "symbol"
18
22
  node.set_attribute :id, id
23
+ node.remove_attribute "width"
24
+ node.remove_attribute "height"
19
25
 
20
26
  process_stroke(node)
21
27
  process_fill(node)
@@ -23,11 +29,11 @@ class SvgSprite
23
29
  end
24
30
 
25
31
  def width
26
- symbol[:width]
32
+ svg[:width]
27
33
  end
28
34
 
29
35
  def height
30
- symbol[:height]
36
+ svg[:height]
31
37
  end
32
38
 
33
39
  def id
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class SvgSprite
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svg_sprite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-05 00:00:00.000000000 Z
11
+ date: 2022-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri