gulp-stacksvg 1.0.2 → 1.0.3

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.
Files changed (3) hide show
  1. package/README.md +10 -10
  2. package/index.js +2 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -49,11 +49,11 @@ Unlike all other methods for assembling a sprite, the stack does not limit us in
49
49
  We can use the stack in all four possible ways:
50
50
 
51
51
  - in markup:
52
- - in `src` of `img` tag — static,
53
- - in the `href` of the `use` tag — with the possibility of repainting,
52
+ - in `src` of `img` tag — static,
53
+ - in the `href` of the `use` tag — with the possibility of repainting,
54
54
  - in styles:
55
- - in `url()` properties `background` — static,
56
- - in `url()` properties `mask` — with the possibility of repainting.
55
+ - in `url()` properties `background` — static,
56
+ - in `url()` properties `mask` — with the possibility of repainting.
57
57
 
58
58
  [Demo page](https://firefoxic.github.io/gulp-stacksvg/test/) to prove it.
59
59
 
@@ -63,7 +63,7 @@ This method was first mentioned in a Simurai [article](https://simurai.com/blog/
63
63
 
64
64
  This can be done much easier. In general, the stack is arranged almost like a symbol sprite, but without changing the icon tag (it remain the `svg` tag, as in the original icon files) and with the addition of a tiny bit of style.
65
65
 
66
- ```svg
66
+ ```xml
67
67
  <?xml version="1.0" encoding="UTF-8"?>
68
68
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
69
69
 
@@ -75,7 +75,7 @@ This can be done much easier. In general, the stack is arranged almost like a sy
75
75
 
76
76
  <img align="left" width="90" height="90" title="sun" src="https://raw.githubusercontent.com/firefoxic/gulp-stacksvg/main/test/stack.svg#sun-alpha">
77
77
 
78
- ```svg
78
+ ```xml
79
79
  <svg id="sun" viewBox="0 0 24 24">
80
80
  <!-- Inner code of sun icon -->
81
81
  </svg>
@@ -83,7 +83,7 @@ This can be done much easier. In general, the stack is arranged almost like a sy
83
83
 
84
84
  <img align="left" width="90" height="90" title="heart" src="https://raw.githubusercontent.com/firefoxic/gulp-stacksvg/main/test/stack.svg#heart-red">
85
85
 
86
- ```svg
86
+ ```xml
87
87
  <svg id="heart" viewBox="0 0 24 24">
88
88
  <!-- Inner code of heart icon -->
89
89
  </svg>
@@ -91,13 +91,13 @@ This can be done much easier. In general, the stack is arranged almost like a sy
91
91
 
92
92
  <img align="left" width="90" height="90" title="thumbup" src="https://raw.githubusercontent.com/firefoxic/gulp-stacksvg/main/test/stack.svg#thumbup-alpha">
93
93
 
94
- ```svg
94
+ ```xml
95
95
  <svg id="thumbup" viewBox="0 0 24 24">
96
96
  <!-- Inner code of thumbup icon -->
97
97
  </svg>
98
98
  ```
99
99
 
100
- ```svg
100
+ ```xml
101
101
  </svg>
102
102
  ```
103
103
 
@@ -141,7 +141,7 @@ And now the icons from the external sprite are available in the styles <img widt
141
141
  ```
142
142
 
143
143
  > ⚠️ Note:
144
- > For the `mask` property, we still need an autoprefixer.
144
+ > We still need the [autoprefixer](https://github.com/postcss/autoprefixer) for the mask property.
145
145
 
146
146
  For an icon inserted via `mask`, simply change the `background`. Moreover, unlike `use`, you can draw anything in the background under the mask, for example, a gradient.
147
147
 
package/index.js CHANGED
@@ -20,7 +20,7 @@ export function stacksvg ({ output = `stack.svg`, separator = `_`, spacer = `-`
20
20
  let isEmpty = true
21
21
  const ids = {}
22
22
  const namespaces = {}
23
- const stack = parse(`<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg"><style>:root{visibility:hidden}:target{visibility:visible}</style></svg>`)
23
+ const stack = parse(`<svg xmlns="http://www.w3.org/2000/svg"><style>:root{visibility:hidden}:target{visibility:visible}</style></svg>`)
24
24
  const rootSvg = stack.querySelector(`svg`)
25
25
  const stream = new Transform({ objectMode: true })
26
26
 
@@ -36,9 +36,7 @@ export function stacksvg ({ output = `stack.svg`, separator = `_`, spacer = `-`
36
36
 
37
37
  const icon = parse(file.contents.toString()).querySelector(`svg`)
38
38
 
39
- if (file && isEmpty) {
40
- isEmpty = false
41
- }
39
+ isEmpty = false
42
40
 
43
41
  const iconId = basename(
44
42
  file.relative.split(sep).join(separator).replace(/\s/g, spacer),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gulp-stacksvg",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "description": "Combine svg files into one with stack method",
6
6
  "main": "index.js",