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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/svg_sprite/svg.rb +9 -3
- data/lib/svg_sprite/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe18c6c07ac1ce4d61936ca9aeed70d8de0b8d1803ab87efd7b85638213aa226
|
4
|
+
data.tar.gz: 1d04666e8320452af0979288eaf388a6b767e564e7659ea9af68096f4fcdb918
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/svg_sprite/svg.rb
CHANGED
@@ -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 ||=
|
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
|
-
|
32
|
+
svg[:width]
|
27
33
|
end
|
28
34
|
|
29
35
|
def height
|
30
|
-
|
36
|
+
svg[:height]
|
31
37
|
end
|
32
38
|
|
33
39
|
def id
|
data/lib/svg_sprite/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2022-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|