Typography

CSS3 introduces a few new units, including theremunit, which stands for"root em".Theremunit is relative to the font-size of the root elementhtml.That means that we can define a single font size on the root element, and define allremunits to be a percentage of that. The typography hasfont-sizedefined in 1.6rem (16px) andline-heightin 1.6 (24px).Milligramuses thefont-familyRoboto,created byChristian Robertson,and provided by Google.

Headingh14.6rem (46px)

Headingh23.6rem (36px)

Headingh32.8rem (28px)

Headingh42.2rem (22px)

Headingh51.8rem (18px)
Headingh61.6rem (16px)
/* Base font-size and line-height */

The base type is 1.6rem (16px) over 1.6 line height (24px)

/* Other elements to text markup */ Anchor Emphasis Small Strong Underline /* Default Headings */

Heading

Heading

Heading

Heading

Heading
Heading
/* The base font-size is set at 62.5% for having the convenience of sizing rems in a way that is similar to using px. So basically 1.6rem = 16px. */

Examples

You can view more examples of using Milligram.

Contributing

Want to contribute? Follow theserecommendations.

Subscribe to our newsletter

The latest news and resources sent straight to your inbox.