javan / sprockets-svgo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sprockets SVGO

Sprockets helpers for optimizing SVG graphics with svgo.

Installing

Install svgo

# Globally
$ npm install -g svgo
# Or as a dependency
$ npm install -s svgo

Bundle

gem 'sprockets', '>= 3.0.0'
gem 'sprockets-svgo'

Using

With SASS

// icons.scss
.bold {
  background-image: svgo-data-uri("images/bold.svg");
}

With ERB

/* icons.css.erb */
.bold {
  background-image: url(<%= svgo_asset_data_uri("images/bold.svg") %>);
}

Licensed under the MIT License

© 2016 Javan Makhmali

About

License:MIT License


Languages

Language:Ruby 97.6%Language:Shell 2.4%