Skip to content

OrdinaryMagic/sassc-inline-svg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sassс-inline-svg

Gem Version Build Status Maintainability Test Coverage

Inline url-encoded SVG with Sassc. Optional variable string replacement included!

Inspired by https://github.com/franzheidl/sass-inline-svg

Installation

gem install sassc-inline-svg

Add this line to your application's Gemfile:

gem 'sassc-inline-svg'

Usage

Sassc-inline-svg adds a inline_svg function you can use with Sass. It url-encodes the contents of the specified file and inlines it in your CSS (Url-encoded SVG is about 30% smaller than base64).

.block {
  background: #0e4573 inline_svg('example.svg', (fillcolor: '#23b3e8')) no-repeat;
}