Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sprite stacking CSS and markup optional in extract mode #132

Closed
ShimShamSam opened this issue May 29, 2017 · 4 comments
Closed

Make sprite stacking CSS and markup optional in extract mode #132

ShimShamSam opened this issue May 29, 2017 · 4 comments
Assignees
Labels

Comments

@ShimShamSam
Copy link

ShimShamSam commented May 29, 2017

Do you want to request a feature, report a bug or ask a question?
Feature

What is the current behavior?
Extract mode always includes a <style> tag and markup for sprite stacking.

What is the expected behavior?
An option to turn this off for those who use <svg><use></use></svg> exclusively.

If this is a feature request, what is motivation or use case for changing the behavior?
Apart from the extraneous data in the exported SVG file, my build setup compiles down to a single CSS and JS file which I hash and include as a nonce in my Content Security Policy header. Since this new version now injects an extra <style> tag for sprite stacking, the console throws a silent error that the <style> tag doesn't have an associated nonce in the CSP.

Example:

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha256-PQmX2D20LVTxXMw/q0RwlgRtaZJZqCjZkLD0q1xzyDY='". Either the 'unsafe-inline' keyword, a hash ('sha256-Kl0oOFCXNACC8wRypDy0qfmAZG1Rd1IPJyGPcb2SthQ='), or a nonce ('nonce-...') is required to enable inline execution.

Please tell us about your environment:

  • Node.js version: 7.6.0
  • webpack version: 2.6.1
  • svg-sprite-loader version: 3.0.3
  • OS type & version: Windows 10
@kisenka kisenka self-assigned this May 30, 2017
@kisenka
Copy link
Contributor

kisenka commented May 31, 2017

@ShimShamSam I wish you suggest the name of this option.

@ShimShamSam
Copy link
Author

spriteStacking (default: true)

Whether or not to include markup to support sprite stacking (allows references to sprites via <img src="icons.svg#my-icon">)

@kisenka
Copy link
Contributor

kisenka commented Aug 18, 2017

Related issue JetBrains/svg-mixer#4

@kisenka
Copy link
Contributor

kisenka commented Oct 16, 2017

@ShimShamSam sorry for the delay, this feature is shipped in svg-sprite-loader@3.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants