Skip to content

Easily generate webfonts from svg files as part of your ember-cli build process

License

Notifications You must be signed in to change notification settings

LoyaltyPlant/ember-cli-webfont

 
 

Repository files navigation

ember-cli-webfont

This addon wraps broccoli-webfont to allow you to easily generate webfonts as part of your ember build process.

Installation

ember install ember-cli-webfont

Usage

By default the addon expects to find your SVG files in app/webfont-svg and will add CSS classes to your generated CSS.

To use the icons you just need to give an element these classes e.g.

<span class="iconfont iconfont-ember"></span>

Will display the SVG from app/webfont-svg/ember.svg (with the default values for path, classPrefix and baseClass - see below).

Configuration

You can configure the behaviour of the addon by passing a hash of options when initialising your ember app. The names of parameters and default options are shown below:

var app = new EmberApp({
  webfont: {
    path: 'app/webfont-svg/',
    options: {
      files: ['**/*.svg'],
      dest: 'assets/webfonts/',
      fontName: 'iconfont',
      cssFontsPath: 'webfonts/',
      cssTemplate: webfont.templates.css,
      templateOptions: {
        classPrefix: 'iconfont-',
        baseClass: 'iconfont'
      }
    }
  }
});

Documentation on these options can be found on the broccoli-webfont and webfonts-generator repositories.

Developing addon

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

About

Easily generate webfonts from svg files as part of your ember-cli build process

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 76.6%
  • HTML 23.4%