No Sheng Sheng default With fonts

Sheng

Sheng is a Sass and CSS library for laying out type on the Web, which is opinionated about sizing and spacing, but leaves fonts and colours up to you.

It is named after Bì Shēng, the inventor of movable type.

It is intended to be a JS-free alternative to typography.js, but is not a pixel-perfect drop-in, instead taking a few different opinions in some places.

Usage

You can either use Sheng as a Sass library, or include its CSS directly if you're not using Sass. Then, you can add further rules to add your fonts, colours, and site-specific customisations.

Sass

The Sass file provides a sheng() mixin, which applies Sheng's styles. It takes the following parameters (all are optional):

You can additionally extend or override styles using Sheng's placeholder selectors, and Sheng will apply them to the appropriate selectors. They are:

@import "~sheng/sheng.scss";
.content {
  @include sheng();
}
%sheng-heading {
  font-family: sans-serif;
  font-weight: 900;
}

CSS

The CSS version is always applied to the .type selector. You can override some of Sheng's defaults using CSS Variables:

@import "https://unpkg.com/sheng@1.0.0/sheng-compiled.css";
.sheng {
  --body-font-family: Helvetica, sans-serif;
}

Example content

Lists

  1. Ordered list item 1
  2. Ordered list item 2
  3. Ordered list item 100