Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Proof of concept for icon font generation using grunt-webfont, Sass

Notifications You must be signed in to change notification settings

rogerhutchings/iconfont-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sass Icon Font Generator

This is a proof of concept for a Sass mixin-powered icon font set. It works by creating an icon font using the grunt-webfont package, and generating an importable Sass file using a custom template to create a variable for each glyph.

These variables can then be passed into a mixin to replace the existing text and put the icon into a pseudo before / after element.

To see it in action, do an initial compile by running grunt and open the demo/index.html file.

Dependencies

Installation

  1. Clone the repo
  2. Install the required node packages by running npm install
  3. Perform an initial compile by running grunt

Usage

HTML:

<span class="icon">
    <span class="icon-filename"></span>
    <span class="screen-reader-text">Text to be replaced</span>
</span>

Sass:

.icon-filename
    @include icon($icon-filename)

Dev

  • To recompile the icon font and Sass: grunt
  • To recompile the font only: grunt webfont
  • To recompile the Sass only: grunt sass

Notes

SVGs from the Cinema icon pack.

About

Proof of concept for icon font generation using grunt-webfont, Sass

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published