I noticed that Adobe Edge fonts add an HTML class for each activated font. I think that would be a nice feature for Google fonts as well. If you have the Webfont Loader module activated, I noticed this happens by default but with just @font-your-face / google_fonts_api, this is not the case. I wrote a patch which I will attach in the comments to make this happen.

A good use case for this is if you'd like to theme groupings of fonts. So for example, one could create a Sass mixin that takes arguments for font size and render these as:

.wf-pathway-gothic-one-regular {
  @include headings(uppercase, .02em, 60px, 9px);
}

.wf-montserrat-regular {
  @include headings(capitalize, .01em, 52px, 8px);
}
etc...
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Danny Englander’s picture

Attaching patch.

Danny Englander’s picture

Issue summary: View changes
Neslee Canil Pinto’s picture

Status: Active » Closed (outdated)