Search code examples
csssasscompass-sassgoogle-font-api

Using Google Web Fonts with SASS/Compass -- how?


Say I have this font: Open Sans

If I want to use this with a SASS/Compass project, is there a better way to do it then linking to an additional stylesheet hosted by Google in order to be able to use the font?


Solution

  • No need for Google. Open Sans is.. well, open… You can host the fonts yourself:

    http://www.fontsquirrel.com/fonts/open-sans

    If you want to be really fancy you can use Bourbon's font-face mixin:

    http://bourbon.io/docs/#font-face

    There's an excellent case to be made for letting Google (or Typekit, etc.) do the heavy lifting, but I prefer to control my own destiny and tend to favor self-hosting when possible. :)