npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ui-kit-typography

v1.0.3

Published

scaled typography for ESS

Downloads

5

Readme

typography

Scaled typography for ESS

Usage

You can use it out of the box

import 'ui-kit-typography/index.ess'

and optionally configure it in your root

{
  typographyBase: 15,
  typographyMargins: false,
  typographyRange: 'h1 h2 h3 p',
  typographyScale: 1.1
}

Skin

You can pass values into index.ess as well, turning it into a skin

.skin
  %../index.ess(scale=1.25 range='&-h1 &-h2 &-h3 &-h4 &-p')

yields

.skin-h1 {
  font-size: 2.9rem;
}
.skin-h2 {
  font-size: 2.3rem;
}
.skin-h3 {
  font-size: 1.9rem;
}
.skin-h4 {
  font-size: 1.5rem;
}
.skin-p {
  font-size: 1.2rem;
}

Extend

You can extend values in your range with extend.ess

.big
  %ui-kit-typography/extend.ess(h1)

// or

.big
  %ui-kit-typography/extend.ess(at='h1')

yields

.big {
  font-size: 3.4rem;
}

Raw Function

A raw function is useful if you want to create quick one-off scales

function SizeScale(args)
  var range = 'big medium small'
  each r in range.split(' ')
    &-`r`
      %../extend.ess(at=r scale=args.scale along=args.along range=range mid=1 margins='none')

.heading
  SizeScale(scale=1.25 along=2)

.paragraph
  SizeScale(scale=1.15 along=1)

yields

.heading-big {
  font-size: 3.1rem;
}
.heading-medium {
  font-size: 2.5rem;
}
.heading-small {
  font-size: 2rem;
}

.paragraph-big {
  font-size: 1.3rem;
}
.paragraph-medium {
  font-size: 1.2rem;
}
.paragraph-small {
  font-size: 1rem;
}

Dynamic

You can even use it dynamically in Jade, as shown in the demo. The API is the same as ESS, so you can do something as simple as

import Typography from 'ui-kit-typography/index.ess?dynamic'

Typography(scale=1.05 range='.Foo-h1 .Foo-h2 .Foo-h3 .Foo-h4'})

Variables

  • base: the base font, applied to the html selector (default: 12)
  • range: a string of selectors which will receive the calculated properties (default: 'h1 h2 h3 h4 h5 h6 h7 h8 p small')
  • scale: the ratio by which to size up or down the range (default: 1.125)
  • along: multiplied with base (to keep rem sane), then used to weight the scale (default: 1.5)
  • round: how much to round the calculated properties. For example, with a value of 1000, a property of 3.33333333333 will be rounded to 3.333 (default: 10)
  • mid: which index in the range to use as the center of the scale (default: 2)
  • addBody: when set to true, the index.ess will apply styles to html or body (default: undefined)

License

MIT