postcss-imperial

PostCSS plugin to support lengths in Imperial and customary units

Usage no npm install needed!

<script type="module">
  import postcssImperial from 'https://cdn.skypack.dev/postcss-imperial';
</script>

README

PostCSS Imperial Build Status

PostCSS plugin to support lengths in Imperial and customary units.

Inspired by Are Imperial Measurements outdated? | Number Hub with Matt Parker | Head Squeeze.

Unit relations graph

Input

.poster {
  height: 2ft;
  width: 1yd;
}

Output

.poster {
  height: 24in;
  width: 36in;
}

Usage

postcss([ require('postcss-imperial') ])

See PostCSS docs for examples for your environment.

Supported Units

  • thou (th, mil)
  • twip
  • point (pt)
  • line, poppyseed
  • pica (pc)
  • barleycorn
  • digit
  • finger
  • inch (in)
  • stick
  • nail
  • palm
  • hand
  • shaftment
  • link
  • span
  • foot (ft)
  • cubit
  • pace
  • yard (yd)
  • ell
  • grade, step
  • fathom (ftm)
  • rod, pole, perch
  • rope
  • chain
  • ramsdenschain
  • shackle
  • skein
  • cable
  • furlong (fur)
  • romanmile
  • mile (mi)
  • nauticalmile
  • league (lea)
  • spindle

Notes

  1. Plurals are supported for convenience.
  2. The ch abbreviation is not supported since it already exists in CSS.

References