Skip to content

Instantly share code, notes, and snippets.

@mateusreis
Last active January 29, 2016 06:07
Show Gist options
  • Save mateusreis/4513213 to your computer and use it in GitHub Desktop.
Save mateusreis/4513213 to your computer and use it in GitHub Desktop.
// 1. Put yout fonts in the compiled folder of your projec. Ex.: www.yoursite.com/css/fonts/
// 2. To enable relative paths to assets via compass helper functions on config.rb uncomment relative_assets = true
// Import the Compass Font Face module
@import "compass/css3/font-face";
// regular
@include font-face('cabin',
font-files(
'Cabin-Regular-webfont.woff', woff,
'Cabin-Regular-webfont.ttf', ttf,
'Cabin-Regular-webfont.svg', svg),
'Cabin-Regular-webfont.eot');
// bold
@include font-face('cabin',
font-files(
'Cabin-Bold-webfont.woff', woff,
'Cabin-Bold-webfont.ttf', ttf,
'Cabin-Bold-webfont.svg', svg),
'Cabin-Bold-webfont.eot'
,bold,normal);
// italic
@include font-face('cabin',
font-files(
'Cabin-Italic-webfont.woff', woff,
'Cabin-Italic-webfont.ttf', ttf,
'Cabin-Italic-webfont.svg', svg),
'Cabin-Italic-webfont.eot'
,normal,italic);
// bold + italic
@include font-face('cabin',
font-files(
'Cabin-BoldItalic-webfont.woff', woff,
'Cabin-BoldItalic-webfont.ttf', ttf,
'Cabin-BoldItalic-webfont.svg', svg),
'Cabin-BoldItalic-webfont.eot'
,bold,italic);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment