Font Face

Author: Aaron Gustafson

Current Version: 0.2

This extension supports the transformation of a format-agmostic font declaration:

@font-face {
  font-family: 'Comfortaa';
  font-weight: normal;
  src: url('fonts/Comfortaa_Regular');
}

into one that follows Paul Irish's Bulletproof @font-face syntax and that's based on what files have been uploaded to the specified location with the same base filename:

@font-face {
  font-family: 'Comfortaa';
  font-weight: normal;
  src: url('fonts/Comfortaa_Regular.eot');
  src: local('Comfortaa'),
       url('fonts/Comfortaa_Regular.ttf') format('truetype'),
       url('fonts/Comfortaa_Regular.otf') format('opentype'),
       url('fonts/Comfortaa_Regular.svg#mysvgid') format('svg');
}

This extension currently supports checks for the following formats:

  1. If you plan to offer SVG font support, add a svg_id to the eCSStender’s methods. This svg_id will be automatically appended to all SVG font URLs:

    eCSStender.addMethod('svg_id','mysvgid');
    view raw extensions.js This Gist brought to you by GitHub.