Skip to content

🚀 📐 Demonstration, example code and workflow blueprint for cross browser compatible responsive svg sprites

Notifications You must be signed in to change notification settings

axe312ger/responsive-svg-sprites

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

responsive-svg-sprites

An example approach to successfully delivery responsive svgs to all browsers - because it was really time to document this.

Work In Progress - Even this readme :)

🚀 ToDo for publication

  • add svgo config for proper minification
  • describe single parts and usage
  • describe how to properly prepare the svgs
  • describe why symbol and the other polyfill are used
  • add custom example file
  • add responsive methods to example
  • add proper ie polyfill to example
  • do cross browsers testing to proof this
  • create autopublish to github pages
  • EXTRA: add animations & colorings to the icons
  • EXTRA: postcss (just simply cssnext?) version
  • EXTRA: add bad shaped svg files to demonstrate SVGO's power

Install

This repo is meant as a demonstration and blueprint. It is not intended to be published to npm. So you need to clone it manually to your machine.

$ git clone git@github.com:axe312ger/responsive-svg-sprites.git
$ cd responsive-svg-sprites
$ npm install

Try

The icons which are glued together by svg-sprite can be found in the icons folder. Feel free to add your own files.

The svg sprite is generated by simply running gulp or entering the following command to your command line.

$ npm run generate

All generated files can be located in the sprite folder. This includes the sprite itself, a sass file containing a map variable with the aspect ratios of every icon and an example with demonstrations how to use this in an actual project.

You can run the generated example(sprite/example/) with any kind of webserver. Or just visit the github.io page of this repository. It contains exactly these files.

Screenshots

Want a quick proof that it works? Have a closer look to the cross browser testing screenshots issue.

Overview

Links

Credits

Beautiful example icons by Oliver Pitsch & Smashing Magazine

This could not even barely work without the work of the following awesome developers:

  • Kir Belevich & contributors with the svg optimization tool SVGO
  • Joschi Kuphal & contributors with the svg sprite generation monster [svg-sprite](Joschi Kuphal)

About

🚀 📐 Demonstration, example code and workflow blueprint for cross browser compatible responsive svg sprites

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published