Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sprockets-svg

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sprockets-svg

  • 1.3.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status Code Climate Gem Version

Sprockets::Svg

SVG toolchain for sprockets

Installation

And then execute:

$ bundle

Or install it yourself as:

$ gem install sprockets-svg

Usage

Ruby on Rails

Add this line to your application's Gemfile:

gem 'sprockets-svg'

From now on, svg files will be automatically optimised.

To link the png version of picture.svg from scss:

#id {
  background-image: image-url(picture.svg.png)
}

or from a view:

<%= image_tag 'picture.svg.png' %>

Standalone Sprockets

If you are using sprockets outside of Rails, to setup sprockets-svg you just need:

assets = Sprockets::Environment.new do |env|
  # Your assets settings
end

require "sprockets-svg"
Sprockets::Svg.install(assets)

Optimizations

For now the only optimization performed is to remove hidden elements.

In the future I'd like to rely on the svgo toolchain.

Contributing

  1. Fork it ( http://github.com//sprockets-svg/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 14 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc