• Stars
    star
    496
  • Rank 88,807 (Top 2 %)
  • Language
    CSS
  • License
    MIT License
  • Created almost 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple, CSS utility classes for advanced typographic features.


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.

  • .liga – Common Ligatures
  • .dlig – Discretionary Ligatures
  • .smcp – Proper Small Caps
  • .c2sc – Caps to Small Caps
  • .caps – Small Caps and Caps to Small Caps, still requires docs
  • .case – Case Sensitive Forms
  • .titl - Titling alternates
  • .calt – Contextual alternates
  • .hist – Historical forms
  • .swsh – Swashes, 1–3, still requires docs
  • .salt – Stylistic Alternates, numbered 1–3 classes still require docs
  • .ss01 – Stylistic Sets, 1–20, still requires docs
  • .frac – Diagonal Fractions
  • .afrc – Alternate Fractions, still requires docs
  • .ordn – Ordinals
  • .sups – Superscripts
  • .subs – Subscripts
  • .sinf – Scientific Inferiors
  • .lnum – Lining numbers
  • .onum – Oldstyle numbers
  • .pnum – Proportinal numbers
  • .tnum – Tabular numbers
  • .zero – Slashes Zero

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

More Repositories

1

normalize-opentype.css

Adds OpenType features—ligatures, kerning, and more—to Normalize.css.
HTML
797
star
2

react-fittext

FitText.js as a React v16+ component.
JavaScript
70
star
3

my-harp-blog

Start a blog with Harp.
CSS
27
star
4

react-flipcard

A flippable card, with almost no opinions on styling.
JavaScript
23
star
5

word-o-mat

JavaScript version of Nina Stössinger’s word-o-mat: generate words for type specimens, spacing, and more.
JavaScript
22
star
6

font-feature-fibbing

Hey, do you support the font-feature-settings CSS property? Safari, look—I know you’re lying!
JavaScript
13
star
7

chasers

Bourbon Neat helpers, making complex, mobile-first layouts a little easier.
CSS
12
star
8

figment

Editorial figure and caption pairings for mobile-first layouts.
CSS
12
star
9

hb-epub3

A Harp boilerplate for creating EPUB3 ebooks.
10
star
10

proof

A very basic template for proofing type with InDesign.
8
star
11

craft-marketplace

Make your Craft Commerce site a Marketplace, via Stripe
PHP
8
star
12

googlefonts-japanese

JavaScript
5
star
13

craft-s3securedownloads

PHP
4
star
14

typecooker-ingredients

TypeCooker’s raw ingredients, via @TypeMyType’s RoboFont extension.
2
star
15

example-dark-mode-readme-specimens

2
star
16

eventuell

A Goodbits template with good typography.
CSS
2
star
17

dodging-bullets

A mobile-first approach to hanging bullets and ordinals for ordered and unordered lists.
CSS
2
star
18

font-service-specifics

Look up a font’s service vendor, through its delivery URL.
JavaScript
2
star
19

utility-opentype.kennethormandy.com

The documentation for Utility OpenType.
HTML
1
star
20

wait-times

The average wait times in Edmonton and area hospitals.
CSS
1
star
21

yonder-expected

Expected example test cases for Yonder.
HTML
1
star
22

default

A starting points for certain projects.
1
star
23

craft-api2pdf

PHP
1
star
24

smokeproofs

Record font performance from Google Fonts, Typekit, and more.
JavaScript
1
star
25

font-feature-abettings

Collect glyph names from a font’s OpenType gsub data.
JavaScript
1
star
26

typecooker-togo

A small TypeCooker app for mobile devices.
JavaScript
1
star