Skip to content

Commit b79bc66

Browse files
authored
Merge pull request #586 from jooby-project/svg-sprites
Update svg-sprites to npm3 and fix Windows git checkout
2 parents adedecb + 0297058 commit b79bc66

5,255 files changed

Lines changed: 329366 additions & 139604 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

jooby-assets-svg-sprites/src/main/resources/dr-svg-sprites/README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Type: `String`
112112
Default value: `""`
113113
Optional
114114

115-
The path where to built a preview page.
115+
The path where to built a preview page.
116116

117117
If the filename part (ending in `.html`) is omitted it will be built from `options.prefix`, `options.name` and `"sprite"`.
118118

@@ -127,7 +127,7 @@ Destination path of the generated stylesheet.
127127
If a filename part is omitted it will get built from `options.cssPrefix`, `options.name`, `"sprite"` and `options.cssSuffix`.
128128

129129
If left blank only svg sprites and png fallbacks are generated.
130-
130+
131131
#### options.prefix
132132
Type: `String`
133133
Default value: `""`
@@ -158,14 +158,14 @@ Type: `String`
158158
Default value: `".svg"`
159159
Optional
160160

161-
Defines a prefix for selectors to target svg sprites.
161+
Defines a prefix for selectors to target svg sprites.
162162

163163
#### options.cssPngPrefix
164164
Type: `String`
165165
Default value: `""`
166166
Optional
167167

168-
Defines a prefix for selectors to target png sprites.
168+
Defines a prefix for selectors to target png sprites.
169169

170170
**Note:** If both `options.cssSvgPrefix` and `options.cssPngPrefix` are empty strings a multiple-background progressive enhancement is used:
171171

@@ -390,8 +390,8 @@ Per default the following plugins are disabled: `moveGroupAttrsToElems`, `colla
390390
Type: `Object`
391391
Optional
392392

393-
This options let's you customise the attributes on the root svg tag in the sprite.
394-
Attributes with falsy values (`false`, `null`, `0` etc) will be omitted from the ouput.
393+
This options let's you customise the attributes on the root svg tag in the sprite.
394+
Attributes with falsy values (`false`, `null`, `0` etc) will be omitted from the ouput.
395395
`viewBox`, `width`, `height` and xml namespaces are all handled automatically - no need to add them here.
396396

397397
```js
@@ -419,6 +419,13 @@ svgAttributes: {
419419

420420
## Changelog
421421

422+
### 1.0.0
423+
424+
Changes:
425+
426+
* Now requires ES6 support (Node 5+).
427+
* Updated to svg2png@4.0.0.
428+
422429
### 0.9.31
423430

424431
Fixed:
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
## Troubleshooting
2-
3-
### Building sprites
4-
5-
#### If the sprites are generated are empty/blank
6-
7-
A. Make sure your config (`options.spriteElementPath`) is pointing to the folder containing your source svg files.
8-
9-
B. If you are using Adobe Illustrator to produce or save your source svg files - ensure the `Responsive` option in the "More Options"panel is **unticked**:
10-
11-
![airesponsiveoption](https://cloud.githubusercontent.com/assets/868834/3855442/28f33768-1ee5-11e4-89db-838b38425568.jpg)
12-
13-
#### If your sprite looks garbled
14-
15-
This is most likely due to one or more [plugins](https://github.com/svg/svgo/tree/master/plugins) in the svg minifier ([svgo](https://github.com/svg/svgo)) used in the sprite builder. If you run into those edge cases disabling plugins can be done via [`options.svgo`](https://github.com/drdk/dr-svg-sprites#optionssvgo). At default the following plugins are disabled: `moveGroupAttrsToElems`, `collapseGroups` and `removeUselessStrokeAndFill`.
16-
If you are unable to find the plugins causing the problem create an issue here and submit as much relevant data as possible.
17-
18-
### In browsers
19-
20-
#### If your sprite isn't displayed - or is very pixelated
21-
22-
Most devices have a maximum allowed buffer for images - if that buffer is exceeded you might experience your sprite either not getting displayed at all - or it getting downsampled.
23-
It's hard to give precise numbers as the maximum buffer varies from device to device - but for iOS it's 3 megapixels (3 * 1024 * 1024 = 3,145,728 pixels) for devices with less than 256mb ram and 5 megapixels for devices with more.
24-
As long as your sprite width times height is below the 3 megapixel range you should be good.
25-
26-
References:
27-
1+
## Troubleshooting
2+
3+
### Building sprites
4+
5+
#### If the sprites are generated are empty/blank
6+
7+
A. Make sure your config (`options.spriteElementPath`) is pointing to the folder containing your source svg files.
8+
9+
B. If you are using Adobe Illustrator to produce or save your source svg files - ensure the `Responsive` option in the "More Options"panel is **unticked**:
10+
11+
![airesponsiveoption](https://cloud.githubusercontent.com/assets/868834/3855442/28f33768-1ee5-11e4-89db-838b38425568.jpg)
12+
13+
#### If your sprite looks garbled
14+
15+
This is most likely due to one or more [plugins](https://github.com/svg/svgo/tree/master/plugins) in the svg minifier ([svgo](https://github.com/svg/svgo)) used in the sprite builder. If you run into those edge cases disabling plugins can be done via [`options.svgo`](https://github.com/drdk/dr-svg-sprites#optionssvgo). At default the following plugins are disabled: `moveGroupAttrsToElems`, `collapseGroups` and `removeUselessStrokeAndFill`.
16+
If you are unable to find the plugins causing the problem create an issue here and submit as much relevant data as possible.
17+
18+
### In browsers
19+
20+
#### If your sprite isn't displayed - or is very pixelated
21+
22+
Most devices have a maximum allowed buffer for images - if that buffer is exceeded you might experience your sprite either not getting displayed at all - or it getting downsampled.
23+
It's hard to give precise numbers as the maximum buffer varies from device to device - but for iOS it's 3 megapixels (3 * 1024 * 1024 = 3,145,728 pixels) for devices with less than 256mb ram and 5 megapixels for devices with more.
24+
As long as your sprite width times height is below the 3 megapixel range you should be good.
25+
26+
References:
27+
2828
* [Know iOS Resource Limits](https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html#//apple_ref/doc/uid/TP40006482-SW15)

0 commit comments

Comments
 (0)