0.0
No commit activity in last 3 years
No release in over 3 years
A small extension for SASS that generates images from icon fonts
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 0
 Project Readme

Sass-FontImage

A small extension for SASS that generates images for icon fonts. This makes it easy to use an image font with :before and :after in browser that support and let's you generate the images on the fly for browser who don't

Usage

We use sass from our custom build script so we add the Rack plugin ourselves. We currently don't support the default sass executable.

Setting up Sass-FontImage with the Rack plugin:

# This must be done AFTER you require 'sass/plugin/rack'
require 'sass-fontimage'

# ... 

# Configure the path where sass-fontimage should write the images
# the path MUST exist.    
Sass::Plugin.options[:custom] ||= {}    
Sass::Plugin.options[:custom][:font_image_location] = "./html/images/fonts"

Syntax

background: font_image(CHARACTER, FONTSIZE, COLOR,  RELATIVE_PATH_TO_FONT)

Example

background: font_image("\E006", 16px, #f00,  "../fonts/testfont-regular.ttf")

Copyright & license

Copyright (c) 2012 Flurin Egger, DigitPaint, MIT Style License. (see MIT-LICENSE)