1.1.0 • Published 7 years ago

postcss-font-weight-names v1.1.0

Weekly downloads
34
License
MIT
Repository
github
Last release
7 years ago

PostCSS Font Weight Names Build Status

PostCSS plugin to convert commonly used font-weight names i.e. Thin, Semi Bold, Heavy, etc.. to a numeric font-weight

Installation

npm install postcss-font-weight-names

Before

.font-weight {
  font-weight: Semi Bold;
}

After

.font-weight {
  font-weight: 600;
}

Font weight name mappings

NameWeight
Thin, Hairline100
Extra Light, Ultra Light200
Light300
Normal, Regular400
Medium500
Semi Bold, Demi Bold600
Bold700
Extra Bold, Ultra Bold800
Black, Heavy900

You can use any of the following ways to write the names: Semi Bold, semi bold, semi-bold, semi_bold.

Usage

postcss([ require('postcss-font-weight-names') ])

See PostCSS docs for examples for your environment.