kennethormandy / utility-opentype

Simple, CSS utility classes for advanced typographic features.
http://utility-opentype.kennethormandy.com
MIT License
500 stars 21 forks source link
css fallback opentype opentype-features sass typography


Utility OpenType

Simple, CSS utility classes for advanced typographic features. Falls back gracefully through feature queries. Less than 1.75kB gzipped. —@kennethormandy

Utility OpenType helps you make the most of the font that you are loading in, reducing convoluted CSS into four-letter, typographic utility classes, because:

  1. OpenType features should be as easy to apply as bold and italics.
  2. OpenType features should cascade predictably.
  3. OpenType features should fallback gracefully.

This is described in more detail in the design decisions. The following examples are supported on Chrome, Firefox, and Internet Explorer 10+ and fallback as gracefully elsewhere. Works on its own, or alongside frameworks like Basscss.

Get started

Utility OpenType is ready to use with Sass, PostCSS, or vanilla CSS. If you’re using Sass or PostCSS, install it through npm:

npm install --save utility-opentype

Then, include it within your source files:

@import "utility-opentype";

If you’re using Sass without Eyeglass modules, you will need to include the actual path to the file in the node_modules directory, for example:

@import "../node_modules/utility-opentype/css/utility-opentype";

If you’d like to use the css directly, download the latest version of the compiled file, or reference the hosted CDN version in your HTML:

<link href="https://cdn.rawgit.com/kennethormandy/utility-opentype/master/css/utility-opentype.min.css" rel="stylesheet">

That’s it! You’re ready to use the classes within your markup.

Classes

Read the full docs with examples.

Running locally

git clone https://github.com/kennethormandy/utility-opentype
cd utility-opentype

# Install development dependencies
npm install

# Run the test basic PostCSS tests
npm test

License

The MIT License (MIT)

Copyright © 2015 Kenneth Ormandy