Documentation and examples for Chi typography.
All components in Chi, including Typography, adhere to a 4px baseline grid. The grid promotes consistency and familiarity through repetition. Chi achieves this repetition by ensuring line-height, padding, border, and margin values are divisible by 4. For user friendliness, Chi utilizes rem units instead of pixels. A rem is a unit of measurement that is equal to the root html font-size. Chi's root is 16px. So 1rem equals 16px.
The sans-serif font stack is used to display all typography within Chi except code. For code, Chi defers to a monospace font stack.
font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif;
font-family: Menlo, Consolas, "Liberation Mono", Courier, monospace;
Headings are used to illustrate the typographic hierarchy of a page. h1
defines the most important heading and h6 the least. Headings in Chi can be defined as tags <h1>
- <h6>
or classes .a-h1
- .a-h6
.
Heading | Example |
---|---|
<h1> | h1 Chi heading |
<h2> | h2 Chi heading |
<h3> | h3 Chi heading |
<h4> | h4 Chi heading |
<h5> | h5 Chi heading |
<h6> | h6 Chi heading |
Chi's default font size is 14px (0.875rem) and is intended to maximize screen real estate in dense, app oriented interfaces.
Font size | Example |
---|---|
14px (0.875rem) | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum lacus lacus, dictum quis mauris vel, commodo condimentum odio. Praesent lacus metus, vehicula at orci ac, fringilla mollis mauris. |
Styles for common inline text elements. Styles can be defined as tags <code>
or classes .a-code
.
Tag | Example |
---|---|
<abbr> | Abbreviated |
<b> | Bold |
<code> | Code |
<del> | |
<em> | Emphasis |
<i> | Italic |
<mark> | Mark |
<small> | Small |
<strong> | Strong |
14px (0.875rem) font size with 24px (1.5rem) line-height
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum lacus lacus, dictum quis mauris vel, commodo condimentum odio. Praesent lacus metus, vehicula at orci ac, fringilla mollis mauris.
<p class="-text"></p>
16px (1rem) font size with 24px (1.5rem) line-height
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum lacus lacus, dictum quis mauris vel, commodo condimentum odio. Praesent lacus metus, vehicula at orci ac, fringilla mollis mauris.
<p class="-text--large"></p>
18px (1.125rem) font size with 28px (1.75rem) line-height
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum lacus lacus, dictum quis mauris vel, commodo condimentum odio. Praesent lacus metus, vehicula at orci ac, fringilla mollis mauris.
<p class="-text--larger"></p>
13px (0.8125rem) font size with 20px (1.25rem) line-height
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum lacus lacus, dictum quis mauris vel, commodo condimentum odio. Praesent lacus metus, vehicula at orci ac, fringilla mollis mauris.
<p class="-text--small"></p>
12px (0.75rem) font size with 20px (1.25rem) line-height
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum lacus lacus, dictum quis mauris vel, commodo condimentum odio. Praesent lacus metus, vehicula at orci ac, fringilla mollis mauris.
<p class="-text--smaller"></p>
Code tags are used to wrap inline snippets of code.
This <code>
will render as inline code.
This <code><code></code> will render as inline code.
Pre tags are used to wrap multiple lines of code.
<p>This code will render as a code block.</p>
<pre>
<code><p>This code will render as a code block.</p></code>
</pre>
Use <ul>
tags for unordered lists and <ol>
tags for ordered lists.
<ul class="-text">
<li></li>
</ul>
<ol class="-text">
<li></li>
</ol>
To remove default list styling, apply the class .-nostyle
<ul class="-text -nostyle">
<li></li>
</ul>
To display list items inline, apply the class .-inline
<ul class="-text -inline">
<li></li>
</ul>
Blockquotes are used to quote content from another source.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum lacus lacus, dictum quis mauris vel, commodo condimentum odio. Praesent lacus metus, vehicula at orci ac, fringilla mollis mauris.
<blockquote>
<p class="-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum lacus lacus, dictum quis mauris vel, commodo condimentum odio. Praesent lacus metus, vehicula at orci ac, fringilla mollis mauris.</p>
</blockquote>
Change text alignment to justified, left, center, or right.
This text will render as justified
This text will render as left aligned
This text will render as center aligned
This text will render as right aligned
<p class="-text--justify">This text will render as justified</p>
<p class="-text--left">This text will render as left aligned</p>
<p class="-text--center">This text will render as center aligned</p>
<p class="-text--right">This text will render as right aligned</p>
Change text transform to lowercase, uppercase, or capitalized.
This text will render as lowercase
This text will render as uppercase
This text will render as capitalized
<p class="-text--lowercase">This text will render as lowercase</p>
<p class="-text--uppercase">This text will render as uppercase</p>
<p class="-text--capitalized">This text will render as capitalized</p>
Change text weight to thin, normal, bold, or bolder.
This text will render as thin
This text will render as normal
This text will render as bold
This text will render as bolder
<p class="-text--thin">This text will render as thin</p>
<p class="-text--normal">This text will render as normal</p>
<p class="-text--bold">This text will render as bold</p>
<p class="-text--bolder">This text will render as bolder</p>
Prevent text wrapping with nowrap or control overflow with truncate.
This text will render without wrapping
This text will truncate with an ellipsis
<p class="-text--nowrap">This text will render without wrapping</p>
<p class="-text--truncate">This text will truncate with an ellipsis</p>
Change text colors with contextual classes.
.-text--brand
.-text--success
.-text--warning
.-text--danger
.-text--info
.-text--muted
.-text--inverse
<p class="-text--brand">.-text--brand</p>
<p class="-text--success">.-text--success</p>
<p class="-text--warning">.-text--warning</p>
<p class="-text--danger">.-text--danger</p>
<p class="-text--info">.-text--info</p>
<p class="-text--muted">.-text--muted</p>
<p class="-text--inverse">.-text--inverse</p>