translate-font-weight
A tiny module that translates font-weight names into appropriate integer values.
Install
$ npm install translate-font-weight
Usage
var translate = var heading = documentvar weight = fontWeight console> 700
API
The following is a list of font weight names and their translated values. All names are case-insensitive, and their hyphens are optional.
names | value |
---|---|
Thin | 100 |
Extra-light, Ultra-light | 200 |
Light | 300 |
Normal, Regular, Roman, Book | 400 |
Medium | 500 |
Semi-bold, Demi-bold | 600 |
Bold | 700 |
Extra-bold, Ultra-bold | 800 |
Black, Heavy | 900 |