Skip to content
A Sass and CSS library for laying out type on the Web
CSS HTML TypeScript JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts
website
.gitignore
.npmignore
.pre-commit-config.yaml
.prettierignore
.prettierrc.json
LICENSE
README.md
netlify.toml
package.json
pnpm-lock.yaml
sheng-compiled.scss
sheng.scss

README.md

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.

Sass

@import "sheng/sheng.scss";
.content {
  @include sheng();
}

CSS

The CSS version is always applied to the .type selector. You can override the defaults using CSS Variables.

@import "https://unpkg.com/sheng@0.1.0/sheng-compiled.css";
.sheng {
  --body-font-family: Helvetica, sans-serif;
}
You can’t perform that action at this time.