Typography

Font styles, sizes, and utilities.

There are two ways to style text with Assembly: by applying utility classes to every element, or by creating prose sections. All typographic styles can be applied individually with classes that have a .txt- prefix. Alternatively, prose sections can be used to apply sensible default styling for all the semantic elements they contain.

Type basics

Classes for font size and line height, lists, block quotes, code blocks, and more.

.txt-kbd

Style text like a keyboard button.

You entered Flamingo.
You entered <kbd class='txt-kbd'>Flamingo</kbd>.
.txt-sub

Style subscript text: small and below the standard line.

The chemical formula of water is H2O.
The chemical formula of water is H<sub class='txt-sub'>2</sub>O.
.pre

Style a code block.

for each
  do this
end
<pre class='pre'>
<code>for each
  do this
end</code>
</pre>
.txt-code

Style text as inline code.

Make sure you git checkout the repository.
Make sure you <code class='txt-code'>git checkout</code> the repository.
.txt-h1.txt-h2.txt-h3.txt-h4.txt-h5

Classes for the headline text scale. Line heights are 1.3333 times font size or less. All text size classes include -mm, -ml, and -mxl variations to target screen sizes.

Malesuada Pharetra Ridiculus
Malesuada Pharetra Ridiculus
Malesuada Pharetra Ridiculus
Malesuada Pharetra Ridiculus
Malesuada Pharetra Ridiculus
<div class='txt-h1'>Malesuada Pharetra Ridiculus</div>
<div class='txt-h2'>Malesuada Pharetra Ridiculus</div>
<div class='txt-h3'>Malesuada Pharetra Ridiculus</div>
<div class='txt-h4'>Malesuada Pharetra Ridiculus</div>
<div class='txt-h5'>Malesuada Pharetra Ridiculus</div>
.txt-xl.txt-l.txt-m.txt-ms.txt-s.txt-xs

Classes for the body text scale. Line heights are 1.5 times font size or more. All text size classes include -mm, -ml, and -mxl variations to target screen sizes.

Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
<div class='txt-xl'>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</div>
<div class='txt-l'>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</div>
<div class='txt-m'>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</div>
<div class='txt-ms'>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</div>
<div class='txt-s'>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</div>
<div class='txt-xs'>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</div>
.txt-abbr

Style an abbreviation or acronym.

How do you feel about CSS?
How do you feel about <abbr title='Cascading Style Sheets' class='txt-abbr'>CSS</abbr>?
.txt-hr

Style a line separating two blocks of text.


<hr class='txt-hr'>
.txt-ul

Style an unordered list. Works with any element type if the list items use the txt-li class, but you should almost always use it with a <ul> element.

one
two
three
<div class='txt-ul'>
  <div class='txt-li'>one</div>
  <div class='txt-li'>two</div>
  <div class='txt-li'>three</div>
</div>
.txt-ol

Style an ordered list. This does not work (in Firefox) without semantic elements <ol> and <li>, so use those.

  1. one
  2. two
  3. three
<ol class='txt-ol'>
  <li class='txt-li'>one</li>
  <li class='txt-li'>two</li>
  <li class='txt-li'>three</li>
</ol>
.txt-blockquote

Style a block quotation.

Donec sed odio dui. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Donec ullamcorper nulla non metus auctor fringilla.
<div class='txt-blockquote'>Donec sed odio dui. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Donec ullamcorper nulla non metus auctor fringilla.</div>
.txt-sup

Style superscript text: small and above the standard line.

Planet earth is seven years old. citation needed
Planet earth is seven years old. <sup class='txt-sup'>citation needed</sup>

Type utils

Single-purpose classes for styling text.

.txt-mono

Apply Assembly's monospaced font stack.

txt-mono
<div class='txt-mono'>txt-mono</div>
.txt-bold

Apply a bold font weight.

txt-bold
<div class='txt-bold'>txt-bold</div>
.txt-light

Apply a light font weight.

txt-light
<div class='txt-light'>txt-light</div>
.txt-normal

Apply a normal font weight.

txt-normal
<div class='txt-normal'>txt-normal</div>
.txt-em

Italicize text.

em
<div class='txt-em'>em</div>
.txt-uppercase

Capitalize all letters in an element.

UpPeRcAsE
<div class='txt-uppercase'>UpPeRcAsE</div>
.txt-lowercase

Lowercase all letters in an element.

LoWeRcAsE
<div class='txt-lowercase'>LoWeRcAsE</div>
.txt-capitalize

Capitalize all words in an element.

all words are capitalized
<div class='txt-capitalize'>all words are capitalized</div>
.txt-capitalize-first

Capitalize the first letter in an element.

first word only is capitalized
<div class='txt-capitalize-first'>first word only is capitalized</div>
.txt-underline

Underline text.

txt-underline
<div class='txt-underline'>txt-underline</div>
.txt-underline-on-hover

Underline text on hover.

txt-underline-on-hover
<span class='txt-underline-on-hover'>txt-underline-on-hover</span>
.txt-strike

Strikethrough text.

txt-strike
<div class='txt-strike'>txt-strike</div>
.txt-nowrap

Prevent text from wrapping.

This text is too long for its container
<div class='border border--gray w60 txt-nowrap'>
  This text is too long for its container
</div>
.txt-wrap

Allow text to wrap, overriding white-space: nowrap set by a component or txt-nowrap.

This text wraps inside its container
<div class='border border--gray w60 txt-nowrap'>
  <span class='txt-wrap'>This text wraps inside its container</span>
</div>
.txt-break-word

Break a word across lines only when it would overflow its container.

Thiswordistoolongforitscontainer
<div class='border border--gray w60 txt-break-word'>
  Thiswordistoolongforitscontainer
</div>
.txt-truncate

Truncate text to a single line contained within the width of its container, ending with an ellipsis if it overflows.

This text is too long for its container
<div class='border border--gray w60 txt-truncate'>
  This text is too long for its container
</div>
.txt-spacing05.txt-spacing1.txt-spacing2

Apply extra space between letters.

spaced out
way spaced out
<div class='txt-spacing05'>spaced out</div>
<div class='txt-spacing2'>way spaced out</div>
.txt-shadow-darken10.txt-shadow-darken25.txt-shadow-darken50.txt-shadow-lighten10.txt-shadow-lighten25.txt-shadow-lighten50

Apply text shadows.

ghost world
ghost world
ghost world
ghost world
ghost world
ghost world
<div class='txt-shadow-darken10'>ghost world</div>
<div class='txt-shadow-darken25'>ghost world</div>
<div class='txt-shadow-darken50'>ghost world</div>
<div class='txt-shadow-lighten10 bg-darken75'>ghost world</div>
<div class='txt-shadow-lighten25 bg-darken75'>ghost world</div>
<div class='txt-shadow-lighten50 bg-darken75'>ghost world</div>
.align-l.align-r.align-center

Control the horizontal alignment of an element's inline children.

.align-l
.align-r
.align-center
<div class='align-l'>.align-l</div>
<div class='align-r'>.align-r</div>
<div class='align-center'>.align-center</div>
.align-t.align-b.align-middle

Control the vertical alignment of an inline or table-cell element.

align-t
align-middle
align-b
<div>
  <span class='align-t inline-block h12 w12 border border--gray'></span>
  <span class='align-t inline-block h60 border border--gray'>align-t</span>
</div>
<div class='mt3'>
  <span class='align-middle inline-block h12 w12 border'></span>
  <span class='align-middle inline-block h60 border border--gray'>align-middle</span>
</div>
<div>
  <span class='align-b inline-block h12 w12 border border--gray'></span>
  <span class='align-b inline-block h60 border border--gray'>align-b</span>
</div>

Prose

Conveniently style large blocks of semantic markup. prose is designed to only be used when content is generated by a markdown processor and you don't have control over each element's class list.

.prose

Apply appropriate styles based on semantic markup. Supported elements are: h1, h2, h3, h4, h5, h6, p, table, small, ul, ol, a, abbr, hr, blockquote, kbd, sub, sup, code, pre, del, s, img, and video.

Tortor Porta

Aenean lacinia bibendum nulla sed consectetur. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam quis risus eget urna mollis ornare vel eu leo.

Cras justo odio, dapibus ac facilisis[note] in, egestas eget quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. H20 electrolitis.

<div class="prose">
  <h1>Tortor Porta</h1>
  <small>Aenean lacinia bibendum nulla sed consectetur. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam quis risus eget urna mollis ornare vel eu leo.</small>
  <hr/>
  <p>Cras justo odio, dapibus ac facilisis<sup>[note]</sup> in, <a href='#'>egestas eget quam</a>. Lorem ipsum <del>dolor</del> sit amet, consectetur adipiscing elit. H<sub>2</sub>0 electrolitis.</p>
</div>
.unprose

Remove prose styling. Useful when you need to display, for example, a custom form inside an otherwise consistently-styled document.

Apply this class directly to the element you want to unstyle. It does not work on containers, only on the elements themselves.

felis euismod semper

Click me

Morbi leo risus

Click me
<div class="prose">
  <h1>felis euismod semper</h1>
  <a class='btn'>Click me</a>
  <h1 class='unprose mt18'>Morbi leo risus</h1>
  <a class='btn unprose'>Click me</a>
</div>
.prose--dark

Invert the coloring of textual content inside prose sections, so it is legible against dark backgrounds.

Tortor Porta

Aenean lacinia bibendum nulla sed consectetur. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam quis risus eget urna mollis ornare vel eu leo.

Cras justo odio, dapibus ac facilisis[note] in, egestas eget quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. H20 electrolitis.

<div class="prose prose--dark bg-gray-deep">
  <h1>Tortor Porta</h1>
  <small>Aenean lacinia bibendum nulla sed consectetur. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam quis risus eget urna mollis ornare vel eu leo.</small>
  <hr/>
  <p>Cras justo odio, dapibus ac facilisis<sup>[note]</sup> in, <a href='#'>egestas eget quam</a>. Lorem ipsum <del>dolor</del> sit amet, consectetur adipiscing elit. H<sub>2</sub>0 electrolitis.</p>
</div>

Layout

Define the size, shape, and content flow of your markup.

Grid

Assembly uses a 12-column CSS Grid with optional gutters.

.grid.col

Grids require at minimum two elements: A parent with the class grid and a child with the class col. A col spans the full row unless you add a w-1/12 to w-11/12 fraction class, which sets how many of the 12 columns it spans. Offset a col that has a width class with an ml-1/12 to ml-11/12 fraction class; other left and right margins on col are ignored inside a grid. The grid class includes *-mm, *-ml, and *-mxl variations to target screen sizes.

Align columns with the flex--*-cross flexbox classes.

one
two
three
<div class='grid'>
  <div class='col w-1/3 border border--darken10'>one</div>
  <div class='col w-1/3 border border--darken10'>two</div>
  <div class='col w-1/3 border border--darken10'>three</div>
</div>
w-1/4-ml
w-3/4-ml
<div class='grid'>
  <div class='col w-1/4-ml border border--darken10'>w-1/4-ml</div>
  <div class='col w-3/4-ml border border--darken10'>w-3/4-ml</div>
</div>
.grid--gut0.grid--gut3.grid--gut6.grid--gut12.grid--gut18.grid--gut24.grid--gut30.grid--gut36.grid--gut60.grid--gut120

Apply column gutters to all columns in a grid by adding a grid--gut{size} modifier to the grid element. For space between rows, add a gapy{size} class. Class set includes *-mm, *-ml, and *-mxl variations to target screen sizes.

w-1/6
w-1/3
w-1/2
col
<div class='grid grid--gut12 gapy12'>
  <div class='col w-1/6 border border--darken10'>w-1/6</div>
  <div class='col w-1/3 border border--darken10'>w-1/3</div>
  <div class='col w-1/2 border border--darken10'>w-1/2</div>
  <div class='col border border--darken10'>col</div>
</div>

Display

Control the display style of elements.

.inline.block.inline-block.none

Set an element's display property value. Class set includes *-mm, *-ml, and *-mxl variations to target screen sizes.

inline
block
inline-block
none
<div class="inline bg-darken10">inline</div>
<div class="block bg-darken10">block</div>
<div class="inline-block bg-darken10">inline-block</div>
<div class="none bg-darken10">none</div>

Positioning

Classes for basic positioning. For flexbox positioning rules, see the documentation for flexbox utilities.

.fixed.absolute.relative.static.sticky

Set an element's position property value. Class set includes *-mm, *-ml, and *-mxl variations to target screen sizes.

absolute
relative
static
static
<div class="relative">
  <div class="absolute bg-darken10 right">absolute</div>
  <div class="relative bg-darken10">relative</div>
  <div class="static bg-darken10">static</div>
  <div class="sticky bg-darken10">static</div>
  <!--
   Fixed positioning would interfere with page
   <div class="fixed bg-darken10">fixed</div>
  -->
</div>
.top.right.left.bottom

Pin a positioned element against a side of its container. Positioning classes can be combined to stretch elements across the top, bottom, left, or right sides of their container. Class set includes *-mm, *-ml, and *-mxl variations to target screen sizes.

right
bottom
left
top left right
<div class="relative h60">
  <div class="absolute bg-darken10 right">right</div>
  <div class="absolute bg-darken10 bottom">bottom</div>
  <div class="absolute bg-darken10 left">left</div>
  <div class="absolute bg-darken10 top left right align-center">top left right</div>
</div>
.z-neg1.z0.z1.z2.z3.z4.z5

Override default stacking order by setting an element's z-index property value. Whenever possible, rely on built-in stacking order and avoid using these classes. Class set includes *-mm, *-ml, and *-mxl variations to target screen sizes.

z5
z1
z-neg1
<div class="relative h60">
  <div class="absolute z5 bg-pink py6 px6">z5</div>
  <div class="absolute z1 bg-blue px6 py6 mt12 ml24">z1</div>
  <div class="absolute z1-neg1 bg-blue px6 py6 mt24 ml60">z-neg1</div>
</div>

Margins

All margin classes fit the following pattern: m<side><size>. And all margin class sets include *-mm, *-ml, and *-mxl variations to target screen sizes.

.mx-auto

Set auto margins on left and right. This pattern is useful for horizontally centering block elements or aligning block elements to the start or end of their container.

mx-auto
ml-auto
mr-auto
<div class='mx-auto w60 bg-darken10'>mx-auto</div>
<div class='ml-auto w60 bg-darken10'>ml-auto</div>
<div class='mr-auto w60 bg-darken10'>mr-auto</div>
.my-neg1.my-neg2.my-neg3.my-neg6.my-neg12.my-neg18.my-neg24.my-neg30.my-neg36.my-neg60.my-neg120.my-neg180.my-neg240.my-neg300.my-neg360.my0.my3.my6.my12.my18.my24.my30.my36.my60.my120.my180.my240.my300.my360

Apply margin on the top and bottom.

my24
<div class='my24 bg-darken10'>my24</div>
.mx-neg1.mx-neg2.mx-neg3.mx-neg6.mx-neg12.mx-neg18.mx-neg24.mx-neg30.mx-neg36.mx-neg60.mx-neg120.mx-neg180.mx-neg240.mx-neg300.mx-neg360.mx0.mx3.mx6.mx12.mx18.mx24.mx30.mx36.mx60.mx120.mx180.mx240.mx300.mx360

Apply margin on the left and right.

mx24
<div class='mx24 bg-darken10'>mx24</div>
.mt-neg1.mt-neg2.mt-neg3.mt-neg6.mt-neg12.mt-neg18.mt-neg24.mt-neg30.mt-neg36.mt-neg60.mt-neg120.mt-neg180.mt-neg240.mt-neg300.mt-neg360.mt0.mt3.mt6.mt12.mt18.mt24.mt30.mt36.mt60.mt120.mt180.mt240.mt300.mt360

Apply margin on the top.

mt24
<div class='mt24 bg-darken10'>mt24</div>
.mr-neg1.mr-neg2.mr-neg3.mr-neg6.mr-neg12.mr-neg18.mr-neg24.mr-neg30.mr-neg36.mr-neg60.mr-neg120.mr-neg180.mr-neg240.mr-neg300.mr-neg360.mr0.mr3.mr6.mr12.mr18.mr24.mr30.mr36.mr60.mr120.mr180.mr240.mr300.mr360

Apply margin on the right.

mr24
<div class='mr24 bg-darken10'>mr24</div>
.mr-1/12.mr-1/6.mr-1/4.mr-1/3.mr-5/12.mr-1/2.mr-7/12.mr-2/3.mr-3/4.mr-5/6.mr-11/12

Apply percentage-based margin on the right.

mr-1/2
w-1/4
<div class='flex'>
  <div class='w-1/4 mr-1/2 bg-darken10'>mr-1/2</div>
  <div class='w-1/4 bg-darken10'>w-1/4</div>
</div>
.mb-neg1.mb-neg2.mb-neg3.mb-neg6.mb-neg12.mb-neg18.mb-neg24.mb-neg30.mb-neg36.mb-neg60.mb-neg120.mb-neg180.mb-neg240.mb-neg300.mb-neg360.mb0.mb3.mb6.mb12.mb18.mb24.mb30.mb36.mb60.mb120.mb180.mb240.mb300.mb360

Apply margin on the bottom.

The negative margin classes, mb-neg, can be useful for certain design patterns like underline tabs.

mb24
<div class='mb24 bg-darken10'>mb24</div>
.ml-neg1.ml-neg2.ml-neg3.ml-neg6.ml-neg12.ml-neg18.ml-neg24.ml-neg30.ml-neg36.ml-neg60.ml-neg120.ml-neg180.ml-neg240.ml-neg300.ml-neg360.ml0.ml3.ml6.ml12.ml18.ml24.ml30.ml36.ml60.ml120.ml180.ml240.ml300.ml360

Apply margin on the left.

ml24
<div class='ml24 bg-darken10'>ml24</div>
.ml-1/12.ml-1/6.ml-1/4.ml-1/3.ml-5/12.ml-1/2.ml-7/12.ml-2/3.ml-3/4.ml-5/6.ml-11/12

Apply percentage-based margin on the left. Inside a grid, these offset a col by the same fraction of the 12 columns; pair them with a w-* fraction class.

ml-1/2
<div class='grid'>
  <div class='col w-1/2 ml-1/2 bg-darken10'>ml-1/2</div>
</div>

Padding

All padding classes fit the following pattern: m<side><size>. And all padding class sets include *-mm, *-ml, and *-mxl variations to target screen sizes.

.py0.py3.py6.py12.py18.py24.py30.py36.py60.py120.py180.py240.py300.py360

Apply padding on the top and bottom.

py24
<div class='py24 bg-darken10'>py24</div>
.px0.px3.px6.px12.px18.px24.px30.px36.px60.px120.px180.px240.px300.px360

Apply padding on the left and right.

px24
<div class='px24 bg-darken10'>px24</div>
.pt0.pt3.pt6.pt12.pt18.pt24.pt30.pt36.pt60.pt120.pt180.pt240.pt300.pt360

Apply padding on the top.

pt24
<div class='pt24 bg-darken10'>pt24</div>
.pr0.pr3.pr6.pr12.pr18.pr24.pr30.pr36.pr60.pr120.pr180.pr240.pr300.pr360

Apply padding on the right.

pr24
<div class='pr24 bg-darken10 align-r'>pr24</div>
.pb0.pb3.pb6.pb12.pb18.pb24.pb30.pb36.pb60.pb120.pb180.pb240.pb300.pb360

Apply padding on the bottom.

pb24
<div class='pb24 bg-darken10'>pb24</div>
.pl0.pl3.pl6.pl12.pl18.pl24.pl30.pl36.pl60.pl120.pl180.pl240.pl300.pl360

Apply padding on the left.

pl24
<div class='pl24 bg-darken10'>pl24</div>

Gap

Gap utilities fit gap{size}, gapx{size}, and gapy{size} on the padding scale. Class sets include *-mm, *-ml, and *-mxl variations to target screen sizes. Use with flex, inline-flex, or grid.

.gap0.gap3.gap6.gap12.gap18.gap24.gap30.gap36.gap60.gap120.gap180.gap240.gap300.gap360

Apply gap on both axes.

a
b
c
<div class='flex flex--wrap gap12'>
  <div class='bg-darken10 px6'>a</div>
  <div class='bg-darken10 px6'>b</div>
  <div class='bg-darken10 px6'>c</div>
</div>
.gapx0.gapx3.gapx6.gapx12.gapx18.gapx24.gapx30.gapx36.gapx60.gapx120.gapx180.gapx240.gapx300.gapx360

Apply column-gap (horizontal gap).

a
b
<div class='flex gapx12'>
  <div class='bg-darken10 px6'>a</div>
  <div class='bg-darken10 px6'>b</div>
</div>
.gapy0.gapy3.gapy6.gapy12.gapy18.gapy24.gapy30.gapy36.gapy60.gapy120.gapy180.gapy240.gapy300.gapy360

Apply row-gap (vertical gap).

a
b
<div class='flex flex--column gapy12'>
  <div class='bg-darken10 px6'>a</div>
  <div class='bg-darken10 px6'>b</div>
</div>

Sizing

All sizing classes fit the following pattern: <w|h><min|max><size> or <w|h><min|max>-full for 100%. And all sizing class sets include *-mm, *-ml, and *-mxl variations to target screen sizes.

.w0.w3.w6.w12.w18.w24.w30.w36.w60.w120.w180.w240.w300.w360.w600.w-full.w-auto

Set an element's width.

In addition to numeric values, there are w-full and w-auto classes.

w60
<div class='w60 bg-darken10'>w60</div>
.w-1/12.w-1/6.w-1/4.w-1/3.w-5/12.w-1/2.w-7/12.w-2/3.w-3/4.w-5/6.w-11/12

Set a percentage-based width.

w-1/2
w-1/4
w-1/4
<div class='grid'>
  <div class='col w-1/2 bg-darken10'>w-1/2</div>
  <div class='col w-1/4 bg-darken25'>w-1/4</div>
  <div class='col w-1/4 bg-darken50'>w-1/4</div>
</div>
.wmax0.wmax3.wmax6.wmax12.wmax18.wmax24.wmax30.wmax36.wmax60.wmax120.wmax180.wmax240.wmax300.wmax360.wmax600.wmax1200.wmax1800.wmax-full.wmax-none

Set an element's maximum width.

In addition to numeric values, there are wmax-full and wmax-none classes.

wmax6
<div class='wmax6 bg-darken10'>wmax6</div>
.wmin0.wmin3.wmin6.wmin12.wmin18.wmin24.wmin30.wmin36.wmin60.wmin120.wmin180.wmin240.wmin300.wmin360.wmin600.wmin-full

Set an element's minimum width.

In addition to numeric values, there is the wmin-full class.

wmin60
<div class='inline-block wmin60 bg-darken10'>wmin60</div>
.h0.h3.h6.h12.h18.h24.h30.h36.h60.h120.h180.h240.h300.h360.h600.h-full.h-auto

Set an element's height.

In addition to numeric values, there are h-full and h-auto classes.

h24
<div class='h24 bg-darken10'>h24</div>
.hmax0.hmax3.hmax6.hmax12.hmax18.hmax24.hmax30.hmax36.hmax60.hmax120.hmax180.hmax240.hmax300.hmax360.hmax600.hmax-full.hmax-none

Set an element's maximum height.

In addition to numeric values, there are hmax-full and hmax-none classes.

hmax12
<div class='hmax12 bg-darken10'>hmax12</div>
.hmin0.hmin3.hmin6.hmin12.hmin18.hmin24.hmin30.hmin36.hmin60.hmin120.hmin180.hmin240.hmin300.hmin360.hmin600.hmin-full

Set an element's minimum height.

In addition to numeric values, there is the hmin-full class.

hmin60
<div class='hmin60 bg-darken10'>hmin60</div>
.h-viewport-full.h-viewport-1/12.h-viewport-1/6.h-viewport-1/4.h-viewport-1/3.h-viewport-5/12.h-viewport-1/2.h-viewport-7/12.h-viewport-2/3.h-viewport-3/4.h-viewport-5/6.h-viewport-11/12

Set a viewport-based height.

h-viewport-1/3
<div class='h-viewport-1/3 bg-darken10'>h-viewport-1/3</div>
.hmax-viewport-full.hmax-viewport-1/12.hmax-viewport-1/6.hmax-viewport-1/4.hmax-viewport-1/3.hmax-viewport-5/12.hmax-viewport-1/2.hmax-viewport-7/12.hmax-viewport-2/3.hmax-viewport-3/4.hmax-viewport-5/6.hmax-viewport-11/12

Set a viewport-based max width.

hmax-viewport-1/3
<div class='hmax-viewport-1/3 h-viewport-1/2 bg-darken10'>hmax-viewport-1/3</div>

Flexbox

Flexbox utilities. All class sets include *-mm, *-ml, and *-mxl variations to target screen sizes.

Usage must fit the following pattern:

  • flex or inline-flex must be on a parent container in order to use flex--* modifiers, while flex-child-* rules control children of a flex or inline-flex element.
  • By default, the main axis is horizontal and the cross axis is vertical. The axes can be inverted with the use of flex--column.
  • To learn about how the flexbox system works, check out "A Complete Guide to Flexbox".
.flex.inline-flex

Establish an element as a flex parent. These classes allow the use of flex--* modifiers, and flex-child-* classes on children.

flex
inline-flex
<div class='bg-darken10 flex'>flex</div>
<div class='bg-darken10 inline-flex'>inline-flex</div>
.flex--column

Set the direction of the main axis to top-to-bottom (default is left-to-right).

1 2 3
<div class='bg-darken10 flex flex--column'>
 <span>1</span>
 <span>2</span>
 <span>3</span>
</div>
.flex--column-reverse

Set the direction of the main axis to bottom-to-top (default is left-to-right).

1 2 3
<div class='bg-darken10 flex flex--column-reverse'>
 <span>1</span>
 <span>2</span>
 <span>3</span>
</div>
.flex--row

Set the direction of the main axis to left-to-right (the default value of flex).

1 2 3
<div class='bg-darken10 flex flex--row'>
 <span>1</span>
 <span>2</span>
 <span>3</span>
</div>
.flex--row-reverse

Set the direction of the main axis to right-to-left (default is left-to-right).

1 2 3
<div class='bg-darken10 flex flex--row-reverse'>
 <span>1</span>
 <span>2</span>
 <span>3</span>
</div>
.flex--center-main

Center an element's children on the main axis.

child
<div class='flex flex--center-main bg-darken10'>
 <div class='bg-darken10'>child</div>
</div>
.flex--center-cross

Center an element's children on the cross axis.

child
<div class='flex flex--center-cross bg-darken10 h120'>
 <div class='bg-darken10'>child</div>
</div>
.flex--start-cross

Align an element's children to the start of the cross axis.

child
child
<div class='flex flex--start-cross h120 bg-darken10'>
 <div class='bg-darken10 h42'>child</div>
 <div class='bg-darken10'>child</div>
</div>
.flex--start-main

Align an element's children to the start of the main axis.

child
<div class='flex flex--start-main bg-darken10'>
 <div class='bg-darken10'>child</div>
</div>
.flex--end-cross

Align an element's children to the end of the cross axis.

child
child
<div class='flex flex--end-cross h120 bg-darken10'>
 <div class='bg-darken10 h42'>child</div>
 <div class='bg-darken10'>child</div>
</div>
.flex--end-main

Align an element's children to the end of the main axis.

child
<div class='flex flex--end-main bg-darken10'>
 <div class='bg-darken10'>child</div>
</div>
.flex--wrap

Allow children to wrap. By default, they are all forced onto one line.

child
child
<div class='flex flex--wrap bg-darken10 overflow-hidden'>
 <div class='bg-darken10 w600'>child</div>
 <div class='bg-darken10 w600'>child</div>
</div>
.flex--stretch-cross

Stretch children to fill the parent container along the cross axis.

child
<div class='flex flex--stretch-cross bg-darken10 h120'>
 <div class='bg-darken10'>child</div>
</div>
.flex--space-between-main

Evenly distribute children across the line, so first child is at the start and last child is at the end.

child
child
<div class='flex flex--space-between-main bg-darken10 h120'>
 <div class='bg-darken10'>child</div>
 <div class='bg-darken10'>child</div>
</div>
.flex--space-around-main

Distribute children with equal space around each item on the main axis.

child
child
<div class='flex flex--space-around-main bg-darken10'>
 <div class='bg-darken10'>child</div>
 <div class='bg-darken10'>child</div>
</div>
.flex--space-evenly-main

Distribute children with equal space between and around items on the main axis.

child
child
<div class='flex flex--space-evenly-main bg-darken10'>
 <div class='bg-darken10'>child</div>
 <div class='bg-darken10'>child</div>
</div>
.flex-child-grow

Make a child grow to fill whatever space is available in the main axis of the parent container. This is useful when you have one or more elements of fixed width, and another element that should take up the remaining space in the row.

Typically, you will also want to apply the flex-child-no-shrink class to the element in the row with a fixed width.

child
child
<div class='flex bg-darken10'>
 <div class='flex-child-no-shrink border w240'>child</div>
 <div class='flex-child-grow border'>child</div>
</div>
.flex-child-no-shrink

Prevent a child from shrinking below its width value.

By default, flex children (even with specified widths) will shrink as needed to accommodate sibling elements. This class prevents that default shrinkage, forcing siblings to accommodate the parent's width.

child
child
child
<div class='flex bg-darken10 w240'>
 <div class='flex-child-no-shrink border w120'>child</div>
 <div class='border w120'>child</div>
 <div class='border w120'>child</div>
</div>

Aspect ratio

Class set includes *-mm, *-ml, and *-mxl variations to target screen sizes.

.aspect-auto.aspect-1/1.aspect-4/3.aspect-3/2.aspect-16/9.aspect-21/9.aspect-3/4.aspect-9/16

Set aspect-ratio. aspect-auto resets it.

aspect-16/9
<div class='aspect-16/9 w-full bg-darken10'>aspect-16/9</div>

Object fit

.object-contain.object-cover.object-fill.object-none.object-scale-down

Set object-fit on replaced elements such as img and video. Class set includes *-mm, *-ml, and *-mxl variations to target screen sizes.

object-cover
<div class='w120 h60 bg-blue object-cover'>object-cover</div>

Transforms

Transform utilities use the individual rotate and scale properties so they compose. Class sets include *-mm, *-ml, and *-mxl variations to target screen sizes.

.rotate0.rotate45.rotate90.rotate180.rotate270.rotate-neg45.rotate-neg90.rotate-neg180.rotate-neg270

Rotate an element. Combines with scale*.

<div class='rotate45 bg-blue w60 h60'></div>
.scale0.scale50.scale75.scale100.scale125.scale150

Scale an element. scale100 is 1. Combines with rotate*.

<div class='scale50 bg-blue w60 h60'></div>

Layout utils

Extra layout utilities.

.bleed.bleed-r.bleed-l.unbleed

Bleed utilities. Bleed classes allow an element inside a centered container to escape the container and meet the edge of the screen. When using the bleed classes, consider adding the .overflow-hidden class on a parent element to prevent horizontal overflow.

Warning: Bleeding elements will never bleed out to more than 50% of the viewport width. So you should not make an element bleed to one side unless it's already on that half of the screen.

Warning: In Firefox, children with negative margins have different layout effects than in other browsers. The bleed classes should only be used if the parent's width is stable, either because it is set or because other children determine it.

Class set includes *-mm, *-ml, and *-mxl variations to target screen sizes. These screen-size variants are best suited to adding the bleed, not removing it. Be aware of the effects of the unbleed class: it resets margin-left, margin-right, and flex-child-grow.

Right bleed
<div class='bg-darken10 flex flex--center-main overflow-hidden'>
  <div class='w240 px12 py12 bg-darken10'>
    <div class='bg-darken10 bleed-r'>Right bleed</div>
  </div>
</div>
.fl.fr.unfloat.clearfix

Float utilities. Class set (except clearfix) includes *-mm, *-ml, and *-mxl variations to target screen sizes.

left
with .clearfix
right
without .clearfix
unfloat
<div class='clearfix'>
  <div class='fl bg-darken10'>left</div>
</div>
<div> with .clearfix </div>
<div class='fr bg-darken10'>right</div>
<div class='bg-darken10'> without .clearfix </div>
<div class='fl unfloat'>unfloat</div>

Theming

Decorate elements with borders, shadows, opacity adjustments, and more.

Borders

Add borders to an element.

.border.border-t.border-r.border-b.border-l

Add a 1px border that is the same color as the element's text. Target sides with *-t, *-r, *-b, and *-l. Class set includes *-mm, *-ml, and *-mxl variations to target screen sizes.

border
border-b
<div class='border'>border</div>
<div class='mt12 border-b'>border-b</div>
.border--0.border-t--0.border-r--0.border-b--0.border-l--0

Make a border zero pixels wide. Class set includes *-mm, *-ml, and *-mxl variations to target screen sizes.

border-r--0
<div class='border border-r--0'>border-r--0</div>
.border--2.border-t--2.border-r--2.border-b--2.border-l--2

Make a border two pixels wide.

border--2
<div class='border border--2'>border--2</div>
.border--dash

Make a border dashed instead of solid.

border--dash
<div class='border border--dash'>border--dash</div>
.border--gray-dark.border--gray-deep.border--gray.border--gray-light.border--gray-lighter.border--gray-faint.border--pink-dark.border--pink-deep.border--pink.border--pink-light.border--pink-lighter.border--pink-faint.border--red-dark.border--red-deep.border--red.border--red-light.border--red-lighter.border--red-faint.border--orange-dark.border--orange-deep.border--orange.border--orange-light.border--orange-lighter.border--orange-faint.border--yellow-dark.border--yellow-deep.border--yellow.border--yellow-light.border--yellow-lighter.border--yellow-faint.border--green-dark.border--green-deep.border--green.border--green-light.border--green-lighter.border--green-faint.border--blue-dark.border--blue-deep.border--blue.border--blue-light.border--blue-lighter.border--blue-faint.border--purple-dark.border--purple-deep.border--purple.border--purple-light.border--purple-lighter.border--purple-faint.border--darken10.border--darken25.border--darken50.border--darken75.border--lighten10.border--lighten25.border--lighten50.border--lighten75.border--white.border--black.border--transparent

Apply a color to a border.

border--red
<div class='border border--red'>border--red</div>
.border--gray-dark-on-hover.border--gray-dark-on-active.border--gray-deep-on-hover.border--gray-deep-on-active.border--gray-on-hover.border--gray-on-active.border--gray-light-on-hover.border--gray-light-on-active.border--gray-lighter-on-hover.border--gray-lighter-on-active.border--gray-faint-on-hover.border--gray-faint-on-active.border--pink-dark-on-hover.border--pink-dark-on-active.border--pink-deep-on-hover.border--pink-deep-on-active.border--pink-on-hover.border--pink-on-active.border--pink-light-on-hover.border--pink-light-on-active.border--pink-lighter-on-hover.border--pink-lighter-on-active.border--pink-faint-on-hover.border--pink-faint-on-active.border--red-dark-on-hover.border--red-dark-on-active.border--red-deep-on-hover.border--red-deep-on-active.border--red-on-hover.border--red-on-active.border--red-light-on-hover.border--red-light-on-active.border--red-lighter-on-hover.border--red-lighter-on-active.border--red-faint-on-hover.border--red-faint-on-active.border--orange-dark-on-hover.border--orange-dark-on-active.border--orange-deep-on-hover.border--orange-deep-on-active.border--orange-on-hover.border--orange-on-active.border--orange-light-on-hover.border--orange-light-on-active.border--orange-lighter-on-hover.border--orange-lighter-on-active.border--orange-faint-on-hover.border--orange-faint-on-active.border--yellow-dark-on-hover.border--yellow-dark-on-active.border--yellow-deep-on-hover.border--yellow-deep-on-active.border--yellow-on-hover.border--yellow-on-active.border--yellow-light-on-hover.border--yellow-light-on-active.border--yellow-lighter-on-hover.border--yellow-lighter-on-active.border--yellow-faint-on-hover.border--yellow-faint-on-active.border--green-dark-on-hover.border--green-dark-on-active.border--green-deep-on-hover.border--green-deep-on-active.border--green-on-hover.border--green-on-active.border--green-light-on-hover.border--green-light-on-active.border--green-lighter-on-hover.border--green-lighter-on-active.border--green-faint-on-hover.border--green-faint-on-active.border--blue-dark-on-hover.border--blue-dark-on-active.border--blue-deep-on-hover.border--blue-deep-on-active.border--blue-on-hover.border--blue-on-active.border--blue-light-on-hover.border--blue-light-on-active.border--blue-lighter-on-hover.border--blue-lighter-on-active.border--blue-faint-on-hover.border--blue-faint-on-active.border--purple-dark-on-hover.border--purple-dark-on-active.border--purple-deep-on-hover.border--purple-deep-on-active.border--purple-on-hover.border--purple-on-active.border--purple-light-on-hover.border--purple-light-on-active.border--purple-lighter-on-hover.border--purple-lighter-on-active.border--purple-faint-on-hover.border--purple-faint-on-active.border--darken10-on-hover.border--darken10-on-active.border--darken25-on-hover.border--darken25-on-active.border--darken50-on-hover.border--darken50-on-active.border--darken75-on-hover.border--darken75-on-active.border--lighten10-on-hover.border--lighten10-on-active.border--lighten25-on-hover.border--lighten25-on-active.border--lighten50-on-hover.border--lighten50-on-active.border--lighten75-on-hover.border--lighten75-on-active.border--white-on-hover.border--white-on-active.border--black-on-hover.border--black-on-active.border--transparent-on-hover.border--transparent-on-active

Apply a border color on hover and active states.

border--red-on-hover
border--red-on-active (not active)
border--red-on-active (active)
<div class='border border--red-on-hover'>border--red-on-hover</div>
<div class='border border--red-on-active'>border--red-on-active (not active)</div>
<div class='border border--red-on-active is-active'>border--red-on-active (active)</div>

Border radius

Adjust the curve of an element's corners. All border classes include *-mm, *-ml, and *-mxl variations to target screen sizes.

.round.round-t.round-r.round-b.round-l.round-tl.round-tr.round-br.round-bl

Round the corners of elements. Target sides with *-t, *-r, *-b, *-l. Target corners with *-tl, *-tr, *-bl, *-br.

round
round-tr
<div class='bg-blue inline-block round'>round</div>
<div class='bg-blue inline-block ml6 round-tr'>round-tr</div>
.round-bold.round-t-bold.round-r-bold.round-b-bold.round-l-bold.round-tl-bold.round-tr-bold.round-br-bold.round-bl-bold

Like round, but with twice the border radius.

round-bold
round-tr-bold
<div class='bg-blue inline-block round-bold'>round-bold</div>
<div class='bg-blue inline-block ml6 round-tr-bold'>round-tr-bold</div>
.round-full.round-t-full.round-r-full.round-b-full.round-l-full.round-tl-full.round-tr-full.round-br-full.round-bl-full

Like round, but with fully round corners.

round-full
round-tr-full
<div class='bg-blue inline-block round-full'>round-full</div>
<div class='bg-blue inline-block ml6 round-tr-full'>round-tr-full</div>
.unround.unround-t.unround-r.unround-b.unround-l.unround-tl.unround-tr.unround-br.unround-bl

Unround the corners of elements. Target sides with *-t, *-r, *-b, *-l. Target corners with *-tl, *-tr, *-bl, *-br.

<input type='text' class='input unround' placeholder='.unround' />

Shadows

Apply outer shadows that add emphasis to elements or structure to layouts. Class naming follows the pattern shadow-<lighten|darken><alpha>.

.shadow-darken10.shadow-darken25.shadow-darken50.shadow-darken75.shadow-lighten10.shadow-lighten25.shadow-lighten50.shadow-lighten75

Apply a box shadow.

shadow-darken25
<div class='shadow-darken25'>shadow-darken25</div>
.shadow-darken10-bold.shadow-darken25-bold.shadow-darken50-bold.shadow-darken75-bold.shadow-lighten10-bold.shadow-lighten25-bold.shadow-lighten50-bold.shadow-lighten75-bold

Apply a larger box shadow.

shadow-darken25-bold
<div class='shadow-darken25-bold'>shadow-darken25-bold</div>
.shadow-darken10-on-hover.shadow-darken10-on-active.shadow-darken10-bold-on-hover.shadow-darken10-bold-on-active.shadow-darken25-on-hover.shadow-darken25-on-active.shadow-darken25-bold-on-hover.shadow-darken25-bold-on-active.shadow-darken50-on-hover.shadow-darken50-on-active.shadow-darken50-bold-on-hover.shadow-darken50-bold-on-active.shadow-darken75-on-hover.shadow-darken75-on-active.shadow-darken75-bold-on-hover.shadow-darken75-bold-on-active.shadow-lighten10-on-hover.shadow-lighten10-on-active.shadow-lighten10-bold-on-hover.shadow-lighten10-bold-on-active.shadow-lighten25-on-hover.shadow-lighten25-on-active.shadow-lighten25-bold-on-hover.shadow-lighten25-bold-on-active.shadow-lighten50-on-hover.shadow-lighten50-on-active.shadow-lighten50-bold-on-hover.shadow-lighten50-bold-on-active.shadow-lighten75-on-hover.shadow-lighten75-on-active.shadow-lighten75-bold-on-hover.shadow-lighten75-bold-on-active

Apply a box shadow on hover and active states.

shadow-darken25-on-hover
shadow-darken25-on-active (not active)
shadow-darken25-on-active (active)
<div class='shadow-darken25-on-hover'>shadow-darken25-on-hover</div>
<div class='shadow-darken25-on-active'>shadow-darken25-on-active (not active)</div>
<div class='shadow-darken25-on-active is-active'>shadow-darken25-on-active (active)</div>

Cursors

Set the style of the cursor when hovering over an element.

.cursor-default.cursor-pointer.cursor-crosshair.cursor-move.cursor-notallowed.cursor-grab.cursor-grabbing.cursor-col-resize.cursor-row-resize

Set the cursor property value of an element.

cursor-pointer
cursor-crosshair
cursor-move
cursor-notallowed
cursor-grab
cursor-grabbing
cursor-col-resize
cursor-row-resize
<div class='cursor-pointer'>cursor-pointer</div>
<div class='cursor-crosshair'>cursor-crosshair</div>
<div class='cursor-move'>cursor-move</div>
<div class='cursor-notallowed'>cursor-notallowed</div>
<div class='cursor-grab'>cursor-grab</div>
<div class='cursor-grabbing'>cursor-grabbing</div>
<div class='cursor-col-resize'>cursor-col-resize</div>
<div class='cursor-row-resize'>cursor-row-resize</div>

Opacity

Dim elements, or hide them from the document flow without removing them.

.opacity0.opacity25.opacity50.opacity75.opacity100

Apply an opacity.

opacity25
opacity50
opacity100
<div class='opacity25'>opacity25</div>
<div class='opacity50'>opacity50</div>
<div class='opacity100'>opacity100</div>
.opacity0-on-hover.opacity0-on-active.opacity25-on-hover.opacity25-on-active.opacity50-on-hover.opacity50-on-active.opacity75-on-hover.opacity75-on-active.opacity100-on-hover.opacity100-on-active.opacity100-on-focus

Apply an opacity on hover and active states.

.opacity100-on-focus is also available to make an otherwise transparent element opaque on focus.

opacity25-on-hover
opacity25-on-active (inactive)
opacity25-on-active (active)
<div class='opacity25-on-hover'>opacity25-on-hover</div>
<div class='opacity25-on-active'>opacity25-on-active (inactive)</div>
<div class='opacity25-on-active is-active'>opacity25-on-active (active)</div>
<button class='opacity0 opacity100-on-focus'>opacity100-on-focus</button>

Dark mode

Prefix any class with dark: to apply it only in dark mode, which follows the user's system color scheme unless the page overrides it. Pair it with the light class it replaces. dark: classes are only available in on-demand builds; the CDN stylesheet doesn't include them.

Set data-theme="dark" or data-theme="light" on <html> to override the system setting. Remove the attribute to follow it again. Try it with this toggle, which sets data-theme on this page:

Your styles

Saved 2 minutes ago

<div class='bg-gray-faint dark:bg-gray-dark color-gray-dark dark:color-white round px18 py18'>
  <p class='txt-bold mb6'>Your styles</p>
  <p class='color-gray dark:color-gray-light mb12'>Saved 2 minutes ago</p>
  <button class='btn btn--blue dark:btn--green'>Publish</button>
</div>

A toggle only needs to set the attribute. Set color-scheme too so native controls and scrollbars match:

js
function setTheme(theme) {
  const root = document.documentElement;
  if (theme === 'system') root.removeAttribute('data-theme');
  else root.setAttribute('data-theme', theme);
  root.style.colorScheme = theme === 'system' ? 'light dark' : theme;
}

dark: works with component classes and their hover and active states, and combines with media query suffixes: dark:block-mm applies block on medium screens and up in dark mode.

Colors

Background and text colors. Colors include dark, light, and faint variations. Be sure to maintain a readable color contrast between background and text. Only use -faint text colors on dark backgrounds.

Text colors

.color-gray-dark.color-gray-deep.color-gray.color-gray-light.color-gray-lighter.color-gray-faint.color-pink-dark.color-pink-deep.color-pink.color-pink-light.color-pink-lighter.color-pink-faint.color-red-dark.color-red-deep.color-red.color-red-light.color-red-lighter.color-red-faint.color-orange-dark.color-orange-deep.color-orange.color-orange-light.color-orange-lighter.color-orange-faint.color-yellow-dark.color-yellow-deep.color-yellow.color-yellow-light.color-yellow-lighter.color-yellow-faint.color-green-dark.color-green-deep.color-green.color-green-light.color-green-lighter.color-green-faint.color-blue-dark.color-blue-deep.color-blue.color-blue-light.color-blue-lighter.color-blue-faint.color-purple-dark.color-purple-deep.color-purple.color-purple-light.color-purple-lighter.color-purple-faint.color-darken10.color-darken25.color-darken50.color-darken75.color-lighten10.color-lighten25.color-lighten50.color-lighten75.color-white.color-black.color-transparent.color-text

Apply a text color with color-{name}.

color-gray-dark
color-gray-deep
color-gray
color-gray-light
color-gray-lighter
color-gray-faint
color-pink-dark
color-pink-deep
color-pink
color-pink-light
color-pink-lighter
color-pink-faint
color-red-dark
color-red-deep
color-red
color-red-light
color-red-lighter
color-red-faint
color-orange-dark
color-orange-deep
color-orange
color-orange-light
color-orange-lighter
color-orange-faint
color-yellow-dark
color-yellow-deep
color-yellow
color-yellow-light
color-yellow-lighter
color-yellow-faint
color-green-dark
color-green-deep
color-green
color-green-light
color-green-lighter
color-green-faint
color-blue-dark
color-blue-deep
color-blue
color-blue-light
color-blue-lighter
color-blue-faint
color-purple-dark
color-purple-deep
color-purple
color-purple-light
color-purple-lighter
color-purple-faint
color-darken10
color-darken25
color-darken50
color-darken75
color-lighten10
color-lighten25
color-lighten50
color-lighten75
color-white
color-black
color-transparent
color-text
<div class='txt-s grid'>
  <div class='col w-1/4 color-gray-dark'>color-gray-dark</div>
  <div class='col w-1/4 color-gray-deep'>color-gray-deep</div>
  <div class='col w-1/4 color-gray'>color-gray</div>
  <div class='col w-1/4 color-gray-light'>color-gray-light</div>
  <div class='col w-1/4 color-gray-lighter'>color-gray-lighter</div>
  <div class='col w-1/4 color-gray-faint'>color-gray-faint</div>
  <div class='col w-1/4 color-pink-dark'>color-pink-dark</div>
  <div class='col w-1/4 color-pink-deep'>color-pink-deep</div>
  <div class='col w-1/4 color-pink'>color-pink</div>
  <div class='col w-1/4 color-pink-light'>color-pink-light</div>
  <div class='col w-1/4 color-pink-lighter'>color-pink-lighter</div>
  <div class='col w-1/4 color-pink-faint'>color-pink-faint</div>
  <div class='col w-1/4 color-red-dark'>color-red-dark</div>
  <div class='col w-1/4 color-red-deep'>color-red-deep</div>
  <div class='col w-1/4 color-red'>color-red</div>
  <div class='col w-1/4 color-red-light'>color-red-light</div>
  <div class='col w-1/4 color-red-lighter'>color-red-lighter</div>
  <div class='col w-1/4 color-red-faint'>color-red-faint</div>
  <div class='col w-1/4 color-orange-dark'>color-orange-dark</div>
  <div class='col w-1/4 color-orange-deep'>color-orange-deep</div>
  <div class='col w-1/4 color-orange'>color-orange</div>
  <div class='col w-1/4 color-orange-light'>color-orange-light</div>
  <div class='col w-1/4 color-orange-lighter'>color-orange-lighter</div>
  <div class='col w-1/4 color-orange-faint'>color-orange-faint</div>
  <div class='col w-1/4 color-yellow-dark'>color-yellow-dark</div>
  <div class='col w-1/4 color-yellow-deep'>color-yellow-deep</div>
  <div class='col w-1/4 color-yellow'>color-yellow</div>
  <div class='col w-1/4 color-yellow-light'>color-yellow-light</div>
  <div class='col w-1/4 color-yellow-lighter'>color-yellow-lighter</div>
  <div class='col w-1/4 color-yellow-faint'>color-yellow-faint</div>
  <div class='col w-1/4 color-green-dark'>color-green-dark</div>
  <div class='col w-1/4 color-green-deep'>color-green-deep</div>
  <div class='col w-1/4 color-green'>color-green</div>
  <div class='col w-1/4 color-green-light'>color-green-light</div>
  <div class='col w-1/4 color-green-lighter'>color-green-lighter</div>
  <div class='col w-1/4 color-green-faint'>color-green-faint</div>
  <div class='col w-1/4 color-blue-dark'>color-blue-dark</div>
  <div class='col w-1/4 color-blue-deep'>color-blue-deep</div>
  <div class='col w-1/4 color-blue'>color-blue</div>
  <div class='col w-1/4 color-blue-light'>color-blue-light</div>
  <div class='col w-1/4 color-blue-lighter'>color-blue-lighter</div>
  <div class='col w-1/4 color-blue-faint'>color-blue-faint</div>
  <div class='col w-1/4 color-purple-dark'>color-purple-dark</div>
  <div class='col w-1/4 color-purple-deep'>color-purple-deep</div>
  <div class='col w-1/4 color-purple'>color-purple</div>
  <div class='col w-1/4 color-purple-light'>color-purple-light</div>
  <div class='col w-1/4 color-purple-lighter'>color-purple-lighter</div>
  <div class='col w-1/4 color-purple-faint'>color-purple-faint</div>
  <div class='col w-1/4 color-darken10'>color-darken10</div>
  <div class='col w-1/4 color-darken25'>color-darken25</div>
  <div class='col w-1/4 color-darken50'>color-darken50</div>
  <div class='col w-1/4 color-darken75'>color-darken75</div>
  <div class='col w-1/4 color-lighten10'>color-lighten10</div>
  <div class='col w-1/4 color-lighten25'>color-lighten25</div>
  <div class='col w-1/4 color-lighten50'>color-lighten50</div>
  <div class='col w-1/4 color-lighten75'>color-lighten75</div>
  <div class='col w-1/4 color-white'>color-white</div>
  <div class='col w-1/4 color-black'>color-black</div>
  <div class='col w-1/4 color-transparent'>color-transparent</div>
  <div class='col w-1/4 color-text'>color-text</div>
</div>
.color-gray-dark-on-hover.color-gray-dark-on-active.color-gray-deep-on-hover.color-gray-deep-on-active.color-gray-on-hover.color-gray-on-active.color-gray-light-on-hover.color-gray-light-on-active.color-gray-lighter-on-hover.color-gray-lighter-on-active.color-gray-faint-on-hover.color-gray-faint-on-active.color-pink-dark-on-hover.color-pink-dark-on-active.color-pink-deep-on-hover.color-pink-deep-on-active.color-pink-on-hover.color-pink-on-active.color-pink-light-on-hover.color-pink-light-on-active.color-pink-lighter-on-hover.color-pink-lighter-on-active.color-pink-faint-on-hover.color-pink-faint-on-active.color-red-dark-on-hover.color-red-dark-on-active.color-red-deep-on-hover.color-red-deep-on-active.color-red-on-hover.color-red-on-active.color-red-light-on-hover.color-red-light-on-active.color-red-lighter-on-hover.color-red-lighter-on-active.color-red-faint-on-hover.color-red-faint-on-active.color-orange-dark-on-hover.color-orange-dark-on-active.color-orange-deep-on-hover.color-orange-deep-on-active.color-orange-on-hover.color-orange-on-active.color-orange-light-on-hover.color-orange-light-on-active.color-orange-lighter-on-hover.color-orange-lighter-on-active.color-orange-faint-on-hover.color-orange-faint-on-active.color-yellow-dark-on-hover.color-yellow-dark-on-active.color-yellow-deep-on-hover.color-yellow-deep-on-active.color-yellow-on-hover.color-yellow-on-active.color-yellow-light-on-hover.color-yellow-light-on-active.color-yellow-lighter-on-hover.color-yellow-lighter-on-active.color-yellow-faint-on-hover.color-yellow-faint-on-active.color-green-dark-on-hover.color-green-dark-on-active.color-green-deep-on-hover.color-green-deep-on-active.color-green-on-hover.color-green-on-active.color-green-light-on-hover.color-green-light-on-active.color-green-lighter-on-hover.color-green-lighter-on-active.color-green-faint-on-hover.color-green-faint-on-active.color-blue-dark-on-hover.color-blue-dark-on-active.color-blue-deep-on-hover.color-blue-deep-on-active.color-blue-on-hover.color-blue-on-active.color-blue-light-on-hover.color-blue-light-on-active.color-blue-lighter-on-hover.color-blue-lighter-on-active.color-blue-faint-on-hover.color-blue-faint-on-active.color-purple-dark-on-hover.color-purple-dark-on-active.color-purple-deep-on-hover.color-purple-deep-on-active.color-purple-on-hover.color-purple-on-active.color-purple-light-on-hover.color-purple-light-on-active.color-purple-lighter-on-hover.color-purple-lighter-on-active.color-purple-faint-on-hover.color-purple-faint-on-active.color-darken10-on-hover.color-darken10-on-active.color-darken25-on-hover.color-darken25-on-active.color-darken50-on-hover.color-darken50-on-active.color-darken75-on-hover.color-darken75-on-active.color-lighten10-on-hover.color-lighten10-on-active.color-lighten25-on-hover.color-lighten25-on-active.color-lighten50-on-hover.color-lighten50-on-active.color-lighten75-on-hover.color-lighten75-on-active.color-white-on-hover.color-white-on-active.color-black-on-hover.color-black-on-active.color-transparent-on-hover.color-transparent-on-active

Apply a text color on hover and active states.

color-red-on-hover
color-red-on-active (not active)
color-red-on-active (active)
<div class='color-red-on-hover'>color-red-on-hover</div>
<div class='color-red-on-active'>color-red-on-active (not active)</div>
<div class='color-red-on-active is-active'>color-red-on-active (active)</div>

Background colors

.bg-gray-dark.bg-gray-deep.bg-gray.bg-gray-light.bg-gray-lighter.bg-gray-faint.bg-pink-dark.bg-pink-deep.bg-pink.bg-pink-light.bg-pink-lighter.bg-pink-faint.bg-red-dark.bg-red-deep.bg-red.bg-red-light.bg-red-lighter.bg-red-faint.bg-orange-dark.bg-orange-deep.bg-orange.bg-orange-light.bg-orange-lighter.bg-orange-faint.bg-yellow-dark.bg-yellow-deep.bg-yellow.bg-yellow-light.bg-yellow-lighter.bg-yellow-faint.bg-green-dark.bg-green-deep.bg-green.bg-green-light.bg-green-lighter.bg-green-faint.bg-blue-dark.bg-blue-deep.bg-blue.bg-blue-light.bg-blue-lighter.bg-blue-faint.bg-purple-dark.bg-purple-deep.bg-purple.bg-purple-light.bg-purple-lighter.bg-purple-faint.bg-darken5.bg-darken10.bg-darken25.bg-darken50.bg-darken75.bg-lighten5.bg-lighten10.bg-lighten25.bg-lighten50.bg-lighten75.bg-white.bg-black.bg-transparent

Apply a background color with bg-{name}.

bg-gray-dark
bg-gray-deep
bg-gray
bg-gray-light
bg-gray-lighter
bg-gray-faint
bg-pink-dark
bg-pink-deep
bg-pink
bg-pink-light
bg-pink-lighter
bg-pink-faint
bg-red-dark
bg-red-deep
bg-red
bg-red-light
bg-red-lighter
bg-red-faint
bg-orange-dark
bg-orange-deep
bg-orange
bg-orange-light
bg-orange-lighter
bg-orange-faint
bg-yellow-dark
bg-yellow-deep
bg-yellow
bg-yellow-light
bg-yellow-lighter
bg-yellow-faint
bg-green-dark
bg-green-deep
bg-green
bg-green-light
bg-green-lighter
bg-green-faint
bg-blue-dark
bg-blue-deep
bg-blue
bg-blue-light
bg-blue-lighter
bg-blue-faint
bg-purple-dark
bg-purple-deep
bg-purple
bg-purple-light
bg-purple-lighter
bg-purple-faint
bg-darken5
bg-darken10
bg-darken25
bg-darken50
bg-darken75
bg-lighten5
bg-lighten10
bg-lighten25
bg-lighten50
bg-lighten75
bg-white
bg-black
bg-transparent
<div class='grid'>
  <div class='col w-1/4 bg-gray-dark py6 px6'>bg-gray-dark</div>
  <div class='col w-1/4 bg-gray-deep py6 px6'>bg-gray-deep</div>
  <div class='col w-1/4 bg-gray py6 px6'>bg-gray</div>
  <div class='col w-1/4 bg-gray-light py6 px6'>bg-gray-light</div>
  <div class='col w-1/4 bg-gray-lighter py6 px6'>bg-gray-lighter</div>
  <div class='col w-1/4 bg-gray-faint py6 px6'>bg-gray-faint</div>
  <div class='col w-1/4 bg-pink-dark py6 px6'>bg-pink-dark</div>
  <div class='col w-1/4 bg-pink-deep py6 px6'>bg-pink-deep</div>
  <div class='col w-1/4 bg-pink py6 px6'>bg-pink</div>
  <div class='col w-1/4 bg-pink-light py6 px6'>bg-pink-light</div>
  <div class='col w-1/4 bg-pink-lighter py6 px6'>bg-pink-lighter</div>
  <div class='col w-1/4 bg-pink-faint py6 px6'>bg-pink-faint</div>
  <div class='col w-1/4 bg-red-dark py6 px6'>bg-red-dark</div>
  <div class='col w-1/4 bg-red-deep py6 px6'>bg-red-deep</div>
  <div class='col w-1/4 bg-red py6 px6'>bg-red</div>
  <div class='col w-1/4 bg-red-light py6 px6'>bg-red-light</div>
  <div class='col w-1/4 bg-red-lighter py6 px6'>bg-red-lighter</div>
  <div class='col w-1/4 bg-red-faint py6 px6'>bg-red-faint</div>
  <div class='col w-1/4 bg-orange-dark py6 px6'>bg-orange-dark</div>
  <div class='col w-1/4 bg-orange-deep py6 px6'>bg-orange-deep</div>
  <div class='col w-1/4 bg-orange py6 px6'>bg-orange</div>
  <div class='col w-1/4 bg-orange-light py6 px6'>bg-orange-light</div>
  <div class='col w-1/4 bg-orange-lighter py6 px6'>bg-orange-lighter</div>
  <div class='col w-1/4 bg-orange-faint py6 px6'>bg-orange-faint</div>
  <div class='col w-1/4 bg-yellow-dark py6 px6'>bg-yellow-dark</div>
  <div class='col w-1/4 bg-yellow-deep py6 px6'>bg-yellow-deep</div>
  <div class='col w-1/4 bg-yellow py6 px6'>bg-yellow</div>
  <div class='col w-1/4 bg-yellow-light py6 px6'>bg-yellow-light</div>
  <div class='col w-1/4 bg-yellow-lighter py6 px6'>bg-yellow-lighter</div>
  <div class='col w-1/4 bg-yellow-faint py6 px6'>bg-yellow-faint</div>
  <div class='col w-1/4 bg-green-dark py6 px6'>bg-green-dark</div>
  <div class='col w-1/4 bg-green-deep py6 px6'>bg-green-deep</div>
  <div class='col w-1/4 bg-green py6 px6'>bg-green</div>
  <div class='col w-1/4 bg-green-light py6 px6'>bg-green-light</div>
  <div class='col w-1/4 bg-green-lighter py6 px6'>bg-green-lighter</div>
  <div class='col w-1/4 bg-green-faint py6 px6'>bg-green-faint</div>
  <div class='col w-1/4 bg-blue-dark py6 px6'>bg-blue-dark</div>
  <div class='col w-1/4 bg-blue-deep py6 px6'>bg-blue-deep</div>
  <div class='col w-1/4 bg-blue py6 px6'>bg-blue</div>
  <div class='col w-1/4 bg-blue-light py6 px6'>bg-blue-light</div>
  <div class='col w-1/4 bg-blue-lighter py6 px6'>bg-blue-lighter</div>
  <div class='col w-1/4 bg-blue-faint py6 px6'>bg-blue-faint</div>
  <div class='col w-1/4 bg-purple-dark py6 px6'>bg-purple-dark</div>
  <div class='col w-1/4 bg-purple-deep py6 px6'>bg-purple-deep</div>
  <div class='col w-1/4 bg-purple py6 px6'>bg-purple</div>
  <div class='col w-1/4 bg-purple-light py6 px6'>bg-purple-light</div>
  <div class='col w-1/4 bg-purple-lighter py6 px6'>bg-purple-lighter</div>
  <div class='col w-1/4 bg-purple-faint py6 px6'>bg-purple-faint</div>
  <div class='col w-1/4 bg-darken5 py6 px6'>bg-darken5</div>
  <div class='col w-1/4 bg-darken10 py6 px6'>bg-darken10</div>
  <div class='col w-1/4 bg-darken25 py6 px6'>bg-darken25</div>
  <div class='col w-1/4 bg-darken50 py6 px6'>bg-darken50</div>
  <div class='col w-1/4 bg-darken75 py6 px6'>bg-darken75</div>
  <div class='col w-1/4 bg-lighten5 py6 px6'>bg-lighten5</div>
  <div class='col w-1/4 bg-lighten10 py6 px6'>bg-lighten10</div>
  <div class='col w-1/4 bg-lighten25 py6 px6'>bg-lighten25</div>
  <div class='col w-1/4 bg-lighten50 py6 px6'>bg-lighten50</div>
  <div class='col w-1/4 bg-lighten75 py6 px6'>bg-lighten75</div>
  <div class='col w-1/4 bg-white py6 px6'>bg-white</div>
  <div class='col w-1/4 bg-black py6 px6'>bg-black</div>
  <div class='col w-1/4 bg-transparent py6 px6'>bg-transparent</div>
</div>
.bg-gray-dark-on-hover.bg-gray-dark-on-active.bg-gray-deep-on-hover.bg-gray-deep-on-active.bg-gray-on-hover.bg-gray-on-active.bg-gray-light-on-hover.bg-gray-light-on-active.bg-gray-lighter-on-hover.bg-gray-lighter-on-active.bg-gray-faint-on-hover.bg-gray-faint-on-active.bg-pink-dark-on-hover.bg-pink-dark-on-active.bg-pink-deep-on-hover.bg-pink-deep-on-active.bg-pink-on-hover.bg-pink-on-active.bg-pink-light-on-hover.bg-pink-light-on-active.bg-pink-lighter-on-hover.bg-pink-lighter-on-active.bg-pink-faint-on-hover.bg-pink-faint-on-active.bg-red-dark-on-hover.bg-red-dark-on-active.bg-red-deep-on-hover.bg-red-deep-on-active.bg-red-on-hover.bg-red-on-active.bg-red-light-on-hover.bg-red-light-on-active.bg-red-lighter-on-hover.bg-red-lighter-on-active.bg-red-faint-on-hover.bg-red-faint-on-active.bg-orange-dark-on-hover.bg-orange-dark-on-active.bg-orange-deep-on-hover.bg-orange-deep-on-active.bg-orange-on-hover.bg-orange-on-active.bg-orange-light-on-hover.bg-orange-light-on-active.bg-orange-lighter-on-hover.bg-orange-lighter-on-active.bg-orange-faint-on-hover.bg-orange-faint-on-active.bg-yellow-dark-on-hover.bg-yellow-dark-on-active.bg-yellow-deep-on-hover.bg-yellow-deep-on-active.bg-yellow-on-hover.bg-yellow-on-active.bg-yellow-light-on-hover.bg-yellow-light-on-active.bg-yellow-lighter-on-hover.bg-yellow-lighter-on-active.bg-yellow-faint-on-hover.bg-yellow-faint-on-active.bg-green-dark-on-hover.bg-green-dark-on-active.bg-green-deep-on-hover.bg-green-deep-on-active.bg-green-on-hover.bg-green-on-active.bg-green-light-on-hover.bg-green-light-on-active.bg-green-lighter-on-hover.bg-green-lighter-on-active.bg-green-faint-on-hover.bg-green-faint-on-active.bg-blue-dark-on-hover.bg-blue-dark-on-active.bg-blue-deep-on-hover.bg-blue-deep-on-active.bg-blue-on-hover.bg-blue-on-active.bg-blue-light-on-hover.bg-blue-light-on-active.bg-blue-lighter-on-hover.bg-blue-lighter-on-active.bg-blue-faint-on-hover.bg-blue-faint-on-active.bg-purple-dark-on-hover.bg-purple-dark-on-active.bg-purple-deep-on-hover.bg-purple-deep-on-active.bg-purple-on-hover.bg-purple-on-active.bg-purple-light-on-hover.bg-purple-light-on-active.bg-purple-lighter-on-hover.bg-purple-lighter-on-active.bg-purple-faint-on-hover.bg-purple-faint-on-active.bg-darken5-on-hover.bg-darken5-on-active.bg-darken10-on-hover.bg-darken10-on-active.bg-darken25-on-hover.bg-darken25-on-active.bg-darken50-on-hover.bg-darken50-on-active.bg-darken75-on-hover.bg-darken75-on-active.bg-lighten5-on-hover.bg-lighten5-on-active.bg-lighten10-on-hover.bg-lighten10-on-active.bg-lighten25-on-hover.bg-lighten25-on-active.bg-lighten50-on-hover.bg-lighten50-on-active.bg-lighten75-on-hover.bg-lighten75-on-active.bg-white-on-hover.bg-white-on-active.bg-black-on-hover.bg-black-on-active.bg-transparent-on-hover.bg-transparent-on-active

Apply a background color on hover and active states.

bg-darken25-on-hover
bg-darken25-on-active (not active)
bg-darken25-on-active (active)
<div class='bg-darken25-on-hover'>bg-darken25-on-hover</div>
<div class='bg-darken25-on-active'>bg-darken25-on-active (not active)</div>
<div class='bg-darken25-on-active is-active'>bg-darken25-on-active (active)</div>

Icons

Assembly uses an SVG icon sprite. To load the sprite, you must must include assembly.js on your page.

Please read the Icons page to learn more about the available icons and the Javascript API section of the home page to learn how to use them.

.icon

The icon class must be appled to an <svg> element. Inside the <svg>, insert a <use> element whose xlink:href attribute points to an icon loaded by assembly.js. All icons are referenced by the string #icon-{name}. By default, icons inherit size from their calculated text size. Change the size of icons by applying w{size} and h{size} classes to the svg.

Be aware that icons are block-level.

To see a list of all available icons, visit the icons page.

<svg class='icon'><use xlink:href='#icon-paint'/></svg>

Buttons

Although the btn class will apply button styling to any element, you should typically apply it to the <button> element. Not a <div> or <span> with a click handler, and not an <a> without an href attribute. <button> is semantically appropriate for anything with a click handler that changes the page dynamically. <button>s receive focus, handle keyboard events, can be disabled, and are fully accessible.

For actual links, you should usually use an <a> with the link class.

.btn

Apply a button style. To change the background color of a button, use a btn--{color} modifier (*-deep and *-dark colors are not available). Buttons have white text unless combined with a color-* class. Buttons have fully rounded corners unless combined with a round-* class.

<button class='btn'>Default</button>
<button class='btn btn--red'>Color</button>
<button class='btn btn--green color-yellow'>More colors</button>
<button class='btn round'>Less rounded</button>
<div class='px6 py6 bg-blue inline-block'>
  <button class='btn btn--white color-blue'>Reverse</button>
</div>
.btn--stroke

Modify a button so its text and borders are colored and its background transparent. The border color and text color will always match. To change the text and border color, use a btn--{color} modifier (*-deep colors are not available).

<button class='btn btn--stroke'>Default</button>
<button class='btn btn--stroke btn--red'>Color</button>
<button class='btn btn--stroke round'>Less rounded</button>
<div class='px6 py6 bg-blue inline-block'>
  <button class='btn btn--stroke btn--white'>Reverse</button>
</div>
.btn--s

Make a button small.

<button class='btn btn--s'>Small</button>
.btn.is-active.btn--stroke.is-active

Apply a darker active state to buttons by adding the is-active class.

<button class='btn is-active'>Active</button>
<button class='btn btn--red is-active'>Red and active</button>
<button class='btn btn--stroke is-active'>Active</button>
<button class='btn btn--stroke btn--red is-active'>Red and active</button>
.btn:disabled

When a button has the disabled attribute, it will be styled accordingly.

<button disabled class='btn'>Disabled button</button>
.btn--pill-stroke

Create pill button groups. Pill groups must be wrapped in a inline-flex container. Every button in a pill group must have

  • a btn class
  • any btn--* modifiers you want (e.g. btn--stroke)
  • a btn--pill or btn--pill-stroke modifier. Use the btn--pill-stroke modifier if the buttons in the pill group are mostly stroke buttons (though active buttons can be non-stroke, if you like that)
  • a btn--pill-* modifier specifying its position (e.g. btn--pill-hc)

For horizontal pills, use

  • inline-flex on the container
  • btn btn--pill(-stroke) btn--pill-hc (center)
  • btn btn--pill(-stroke) btn--pill-hl (left)
  • btn btn--pill(-stroke) btn--pill-hr (right)

For vertical pills, use

  • inline-flex flex--column on the container
  • btn btn--pill(-stroke) btn--pill-vc (center)
  • btn btn--pill(-stroke) btn--pill-vt (top)
  • btn btn--pill(-stroke) btn--pill-vb (bottom)

Pill buttons can be modified and themed in the same ways as regular buttons.

<div class="inline-flex">
  <button class="btn btn--pill btn--pill-hl">Left</button>
  <button class="btn btn--pill btn--pill-hc">Center</button>
  <button class="btn btn--pill btn--pill-hr">Right</button>
</div>
<div class="inline-flex flex--column">
  <button class="btn btn--stroke btn--pill-stroke btn--pill-vt">Top</button>
  <button class="btn btn--pill-stroke btn--pill-vc is-active">Center</button>
  <button class="btn btn--stroke btn--pill-stroke btn--pill-vb">Bottom</button>
</div>

Links

Create clickable, hoverable, focusable, colored text. These classes are often used for actual <a> elements with href attributes, but might prove useful for <button>s, as well, depending on semantics.

.link

Style a link. By default, the link class turns text blue, and provides dark blue hover and active states. Change the color with a link--{color} modifier. Links are underlined when focused.

<a href='#Links' class='link'>A link</a>
<a href='#Links' class='link link--red'>A red link</a>
.link.is-active

Apply a darker active state to links by adding the is-active class.

<a href='#Links' class='link is-active'>Active</a>
<a href='#Links' class='link link--red is-active'>Red and active</a>
.link:disabled

When a form element like button includes both the link class and the disabled attribute, it will be styled accordingly. The disabled property has no visual effect on a elements.

<button href='#Links' disabled class='link'>A disabled link</button>
<button href='#Links' disabled class='link link--red'>A disabled red link</button>

Forms

Styles for HTML5 input and textarea elements. All form elements fit into Assembly's 6px baseline grid.

Inputs & textareas

The input class styles input types text, password, email, datetime, search, tel, url, and number. The textarea class styles the <textarea> element.

Both form elements fill the width of their container, by default. You should adjust the widths of inputs and textareas by adding w* width classes or controlling the widths of their containers, e.g. with grid classes.

.input

Style a text input. Set the color of the border with a input--border-{color} modifier (*-dark colors are not available).

<input class='input' placeholder='default' />
<input class='input input--border-green w240' placeholder='green' />
.input--s

Make an input small.

<input class='input input--s' placeholder='small' />
.textarea

Style a textarea. Set the color of the border with a textarea--border-{color} modifier (*-deep and *-dark colors are not available).

<textarea placeholder='default' class='textarea'></textarea>
<textarea placeholder='pink' class='textarea textarea--border-pink w240'></textarea>
.textarea--s

Make a textarea extra small.

<textarea class='textarea textarea--s'>small textarea</textarea>
.input:disabled.textarea:disabled.select--stroke:disabled

When input and textarea elements have a disabled attribute, they will be styled accordingly.

<input disabled class='input' placeholder='disabled' />
<textarea disabled class='textarea' placeholder='disabled' value='Disabled'>Disabled text</textarea>
.input[readonly].textarea[readonly]

When input and textarea elements have a readonly attribute, they will be styled accordingly.

<input readonly class='input' placeholder='basic' value='Readonly' />
<textarea readonly class='textarea' placeholder='basic' value='Disabled' >Readonly text</textarea>

Selects

The select component styles the <select> element. The markup must fit the following pattern:

  • A wrapping <div> with the select-container class.
  • A <select> element with the select class.
  • A <div> with the select-arrow class.
.select-container.select.select-arrow

Style a select component. Set the text and arrow color by adding a select--{color} modifier to the select element (*-dark colors are not available).

<div class='select-container'>
  <select class='select'>
    <option>default</option>
    <option>two</option>
  </select>
  <div class='select-arrow'></div>
</div>
<div class='select-container'>
  <select class='select select--green'>
    <option>default</option>
    <option>two</option>
  </select>
  <div class='select-arrow'></div>
</div>
.select--s

Make a select component small.

<div class='select-container'>
  <select class='select select--s'>
    <option>one</option>
    <option>two</option>
  </select>
  <div class='select-arrow'></div>
</div>
.select--stroke

Modify a select component so that it has a border. Set the border and arrow color by adding a select--{color} modifier to the select element along with the select--stroke modifier (*-dark colors are not available). Note that the select--stroke modifier changes how the color modifier is interpreted.

<div class='select-container'>
  <select class='select select--stroke'>
    <option>one</option>
    <option>two</option>
  </select>
  <div class='select-arrow'></div>
</div>
<div class='select-container mt6'>
  <select class='select select--stroke select--green'>
    <option>green</option>
    <option>two</option>
  </select>
  <div class='select-arrow'></div>
</div>
.select:disabled

When the select element has the disabled attribute, the component will be styled accordingly.

<div class='select-container'>
  <select disabled class='select'>
    <option>one</option>
    <option>two</option>
  </select>
  <div class='select-arrow'></div>
</div>
<div class='select-container'>
  <select disabled class='select select--stroke'>
    <option>one</option>
    <option>two</option>
  </select>
  <div class='select-arrow'></div>
</div>

Ranges

The range class styles the <input type='range'> element. The markup must fit the following pattern:

  • A wrapping <div> with the range class.
  • An <input type='range'> element.
.range

Style a range element.

The best way to vertically align range elements with other items on the same row is to wrap the row in a flex flex--center-cross container. For more details, read about the flexbox classes.

<div class='range'>
  <input type='range' />
</div>
.range--s

Make a range element small.

<div class='range range--s'>
  <input type='range' />
</div>
.range:disabled

When a range element has the disabled attribute, it will be styled accordingly.

<div class='range'>
  <input disabled type='range' />
</div>

Checkboxes

The checkbox component styles the <input type='checkbox' /> element. The markup must fit the following pattern:

  • A wrapping <label> with the class checkbox-container.
  • An <input type='checkbox' />. You may want to add a mr* margin-right class to separate the checkbox from its label.
  • A <div> with the class checkbox containing an <svg> with the chosen icon (usually #icon-check).
.checkbox

Style a checkbox with a label. Change the color of the checkbox with a checkbox--{color} modifier (*-dark colors are not available). Adjust the line height of the checkbox to match a label with small text with the checkbox--s-label modifier.

<label class='checkbox-container'>
    <input type='checkbox' />
    <div class='checkbox mr6'>
      <svg class='icon'><use xlink:href='#icon-check' /></svg>
    </div>
    More cats
  </label>
  <label class='txt-s checkbox-container ml24'>
    <input type='checkbox' />
    <div class='checkbox mr6 checkbox--s-label checkbox--red'>
      <svg class='icon'><use xlink:href='#icon-check' /></svg>
    </div>
    More mice
  </label>
input:disabled + .checkbox

When a checkbox has the disabled attribute, it will be styled accordingly.

<label class="checkbox-container mr6">
  <input disabled type='checkbox'>
  <div class='checkbox'>
    <svg class='icon'><use xlink:href='#icon-check' /></svg>
  </div>
</label>
<label class="checkbox-container">
  <input checked disabled type='checkbox'>
  <div class='checkbox'>
    <svg class='icon'><use xlink:href='#icon-check' /></svg>
  </div>
</label>

Radio buttons

The radio component styles the <input type='radio'> element. The markup must fit the following pattern:

  • A wrapping <label> with the class radio-container.
  • An <input type='radio'>. You may want to add a mr* margin-right class to separate the radio from its label.
  • A <div> with the class radio.
.radio

Style a radio button. Change the color of the radio button with a radio--{color} modifier (*-dark colors are not available). Adjust the line height of the radio button to match a label with small text with the radio--s-label modifier.

<label class='radio-container'>
  <input name='radio-basic' type='radio'>
  <div class='radio mr6'></div>
  Orange
</label>
<label class='txt-s ml24 radio-container'>
  <input name='radio-basic' type='radio'>
  <div class='radio radio--s-label radio--yellow mr6'></div>
  Apple
</label>
input:disabled + .radio

When a radio button has the disabled attribute, it will be styled accordingly.

<label class='radio-container'>
  <input disabled type='radio'>
  <div class='radio'></div>
</label>
<label class='radio-container'>
  <input disabled checked type='radio'>
  <div class='radio'></div>
</label>

Switches

The switch component styles the <input type='checkbox' /> element. The markup must fit the following pattern:

  • A wrapping <label> with the class switch-container.
  • An <input type='checkbox' /> as a direct child of the container.
  • A <div> with the class switch. It can sit anywhere inside the container, so a label can come before or after it. You may want to add a mr* or ml* margin class to separate the switch from its label.
.switch

Style a switch. It is 24px tall to match small inputs like input--s. Change the background when active with a switch--{color} modifier (*-dark colors are not available). Change the color of the dot when active with a switch--dot-{color} modifier. To change the inactive track color, target your own class alongside .switch without !important so the active and disabled states still apply.

<label class='switch-container'>
  <input type='checkbox' />
  <div class='switch'></div>
</label>
<label class='switch-container'>
  <input type='checkbox' />
  <div class='switch switch--pink switch--dot-yellow mr6'></div>
  Enable
</label>
<style>
  .my-switch {
    background-color: #f2c4a8;
  }
</style>
<label class='switch-container'>
  <input type='checkbox' />
  <div class='switch my-switch mr6'></div>
  Custom
</label>
.switch--l

Make a switch 36px tall to match the default input height.

<label class='switch-container'>
  <input type='checkbox' />
  <div class='switch switch--l mr6'></div>
  Really enable
</label>
.switch--s

Make a switch 18px tall to sit alongside small text.

<label class='switch-container txt-s'>
  <input type='checkbox' />
  <div class='switch switch--s mr6'></div>
  Barely enable
</label>
input:disabled + .switch

When a switch has the disabled attribute, it will be styled accordingly.

<label class="switch-container mr6">
  <input disabled type='checkbox'>
  <div class="switch"></div>
</label>
<label class="switch-container">
  <input checked disabled type='checkbox'>
  <div class="switch"></div>
</label>

Toggle group

The toggle group component styles a set of <input type=radio'> elements. The markup must fit the following pattern:

  • A wrapping <div> around all your radio options with the class toggle-group.
  • For each radio option, a wrapping <label> with the class toggle-container.
  • For each radio option, an <input type='radio'>.
  • For each radio option, a <div> with the class toggle.
.toggle-group.toggle-container.toggle

Style a toggle group. Change the inactive toggle text color and the active toggle background color with a toggle--{color} modifier (*-dark colors are not available). Change the active label color with a toggle--active-{color} modifier (*-dark colors are not available). Change the group background color by adding a bg-{color} class to the toggle-group element.

<div class='toggle-group mr18'>
  <label class='toggle-container'>
    <input checked name='toggle-1' type='radio' />
    <div class='toggle'>cat</div>
  </label>
  <label class='toggle-container'>
    <input name='toggle-1' type='radio' />
    <div class='toggle'>dog</div>
  </label>
</div>
<div class='toggle-group bg-blue-faint'>
  <label class='toggle-container'>
    <input checked name='toggle-2' type='radio' />
    <div class='toggle toggle--blue'>cat</div>
  </label>
  <label class='toggle-container'>
    <input name='toggle-2' type='radio' />
    <div class='toggle toggle--blue'>dog</div>
  </label>
</div>

Toggle labels don't wrap. To fit a group with long labels to its container, add wmax-full to the toggle-group, then either:

  • Truncate: add wmin0 to the long label's toggle-container and txt-truncate align-center py3 to its toggle. Add flex-child-no-shrink to other toggle-container elements to keep them whole.
  • Wrap: add flex to each toggle-container and txt-wrap align-center h-auto hmin24 py3 to each toggle. Use hmin18 with toggle--s or hmin36 with toggle--l.
<div class='w240 mb12'>
  <div class='toggle-group wmax-full'>
    <label class='toggle-container wmin0'>
      <input checked name='toggle-truncate' type='radio' />
      <div class='toggle txt-truncate align-center py3'>The quick brown fox jumped over the lazy dog</div>
    </label>
    <label class='toggle-container flex-child-no-shrink'>
      <input name='toggle-truncate' type='radio' />
      <div class='toggle'>dog</div>
    </label>
  </div>
</div>
<div class='w240'>
  <div class='toggle-group wmax-full'>
    <label class='toggle-container flex'>
      <input checked name='toggle-wrap' type='radio' />
      <div class='toggle txt-wrap align-center h-auto hmin24 py3'>The quick brown fox jumped over the lazy dog</div>
    </label>
    <label class='toggle-container flex'>
      <input name='toggle-wrap' type='radio' />
      <div class='toggle txt-wrap align-center h-auto hmin24 py3'>dog</div>
    </label>
  </div>
</div>
.toggle--s.toggle--l

Change the toggle height. toggle--s is 18px tall, the default toggle is 24px to match input--s, and toggle--l is 36px to match input.

<div class='toggle-group mr18'>
  <label class='toggle-container'>
    <input checked name='toggle-small' type='radio' />
    <div class='toggle toggle--s'>mouse</div>
  </label>
  <label class='toggle-container'>
    <input name='toggle-small' type='radio' />
    <div class='toggle toggle--s'>cricket</div>
  </label>
</div>
<div class='toggle-group'>
  <label class='toggle-container'>
    <input checked name='toggle-large' type='radio' />
    <div class='toggle toggle--l'>horse</div>
  </label>
  <label class='toggle-container'>
    <input name='toggle-large' type='radio' />
    <div class='toggle toggle--l'>ox</div>
  </label>
</div>
input:disabled + .toggle

When a toggle group input has the disabled attribute, it will be styled accordingly.

<div class='toggle-group'>
  <label class='toggle-container'>
    <input disabled name='pet' type='radio' />
    <div class='toggle'>cat</div>
  </label>
  <label class='toggle-container'>
    <input disabled checked name='pet' type='radio' />
    <div class='toggle'>dog</div>
  </label>
</div>

Tables

Use tables to display tabular data.

.table

Apply standard table styling.

Malesuada Tristique Commodo Nibh Commodo
item item
item item
<table class='table'>
  <thead>
    <tr>
      <th>Malesuada Tristique Commodo</th>
      <th>Nibh Commodo</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>item</td>
      <td>item</td>
    </tr>
    <tr>
      <td>item</td>
      <td>item</td>
    </tr>
  </tbody>
</table>
.table--dark

Invert a table's colors so it is legible against a dark background.

Malesuada Tristique Commodo Nibh Commodo
item item
item item
<div class='bg-darken75 px12 py12'>
  <table class='table table--dark'>
    <thead>
      <tr>
        <th>Malesuada Tristique Commodo</th>
        <th>Nibh Commodo</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>item</td>
        <td>item</td>
      </tr>
      <tr>
        <td>item</td>
        <td>item</td>
      </tr>
    </tbody>
  </table>
</div>
.table--fixed

Force the width of all columns in a table to be determined by any designated widths of columns in the first row, independent of each cell's content. Any columns whose widths are not specified (by their top cells) will be equally distributed across the available space.

Malesuada Tristique Commodo Nibh Commodo Fusce
Fusce Curabitur blandit tempus porttitor. Aenean Adipiscing
Donec ullamcorper nulla non metus auctor fringilla. Maecenas faucibus mollis interdum. Maecenas sed diam eget risus varius blandit sit amet non magna. Nullam quis risus eget urna mollis ornare vel eu leo. Cras Inceptos Purus
<table class='table table--fixed'>
  <thead>
    <tr>
      <th>Malesuada Tristique Commodo</th>
      <th>Nibh Commodo</th>
      <th class='w240'>Fusce</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Fusce</td>
      <td>Curabitur blandit tempus porttitor.</td>
      <td>Aenean Adipiscing</td>
    </tr>
    <tr>
      <td>Donec ullamcorper nulla non metus auctor fringilla. Maecenas faucibus mollis interdum.</td>
      <td>Maecenas sed diam eget risus varius blandit sit amet non magna. Nullam quis risus eget urna mollis ornare vel eu leo.</td>
      <td>Cras Inceptos Purus</td>
    </tr>
  </tbody>
</table>

Animations

Animations and animation modifiers.

.animation-pulse.animation-spin.animation-fade-in.animation-fade-out.animation-fade-in-out.animation-shake

Transition and reaction animations. By default, these run once for 1.5 seconds.

<div class="bg-blue inline-block mr18 w60 h60 round animation-pulse animation--infinite"></div>
<div class="bg-blue inline-block mr18 w60 h60 round animation-spin animation--infinite"></div>
<div class="bg-blue inline-block mr18 w60 h60 round animation-fade-in animation--infinite"></div>
<div class="bg-blue inline-block mr18 w60 h60 round animation-fade-out animation--infinite"></div>
<div class="bg-blue inline-block mr18 w60 h60 round animation-fade-in-out animation--infinite"></div>
<div class="bg-blue inline-block mr18 w60 h60 round animation-shake animation--infinite"></div>
.animation-shimmer

Sweep a highlight across an element to show it is loading or updating. Works on any background color except white. Runs infinitely for 1.5 seconds per sweep; use the speed and delay modifiers below to change it.

<div class="bg-gray-lighter round h36 mb12 animation-shimmer"></div>
<div class="bg-green round h36 mb12 animation-shimmer"></div>
<div class="bg-gray-dark round px12 py12">
  <div class="bg-lighten10 round h36 animation-shimmer"></div>
</div>
.animation--speed-025.animation--speed-05.animation--speed-1.animation--speed-2.animation--speed-4.animation--delay

Animation duration modifiers. Change animation duration with an animation--speed-{seconds} modifier. Add a 1 second delay with animation--delay.

<div class="bg-blue inline-block mr18 w60 h60 round animation-spin animation--infinite animation--speed-025"></div>
<div class="bg-blue inline-block mr18 w60 h60 round animation-spin animation--infinite animation--speed-05"></div>
<div class="bg-blue inline-block mr18 w60 h60 round animation-spin animation--infinite animation--speed-1"></div>
<div class="bg-blue inline-block mr18 w60 h60 round animation-spin animation--infinite animation--speed-2"></div>
<div class="bg-blue inline-block mr18 w60 h60 round animation-spin animation--infinite animation--speed-4"></div>
<div class="bg-blue inline-block mr18 w60 h60 round animation-spin animation--infinite animation--delay"></div>
.animation--infinite

Repeat an animation infinitely with a animation--infinite modifier.

<div class="bg-blue inline-block mr18 w60 h60 round animation-spin animation--infinite"></div>

Triangles

Create general-purpose triangle-shaped elements. Great for dialog boxes and tooltips.

.triangle.triangle--u.triangle--r.triangle--d.triangle--l

Style simple small triangles.

<div class='triangle--u triangle color-blue inline-block'></div>
<div class='triangle--r triangle color-green inline-block'></div>
<div class='triangle--d triangle color-orange inline-block'></div>
<div class='triangle--l triangle color-pink inline-block'></div>
.triangle-l.triangle-l--u.triangle-l--r.triangle-l--d.triangle-l--l

Style large triangles.

<span class='triangle-l triangle-l--u color-blue inline-block'></span>
<span class='triangle-l triangle-l--r color-green inline-block'></span>
<span class='triangle-l triangle-l--d color-orange inline-block'></span>
<span class='triangle-l triangle-l--l color-pink inline-block'></span>

Miscellaneous

Extra rules that come in handy.

.scroll-styled

Style scrollbars. Only works in Webkit-based browsers (Safari and Chrome). On dark backgrounds, add the scroll-styled--dark modifier.

Use in combination with overflow-auto.

<div class="scroll-styled overflow-auto h120"><div class='h240'></div></div>
<div class="scroll-styled scroll-styled--dark bg-gray-dark overflow-auto h120"><div class='h240'></div></div>
.loading.loading--dark.loading--s

Style a loading spinner. On dark backgrounds, add the loading--dark modifier. For a smaller spinner, add the loading--s modifier. Use color-* classes to apply a custom color to the spinner handle.

<div class="loading"></div>
<div class="loading loading--s"></div>
<div class="bg-gray-dark">
  <div class="loading loading--dark"></div>
</div>
<div class="bg-gray">
  <div class="loading color-lighten50"></div>
</div>
.visible-on-parent-hover

Hide an element until its parent is hovered or contains keyboard focus.

Hover this row
<div class='flex flex--center-cross border border--gray-light round px12 py12'>
  <span class='flex-child-grow'>Hover this row</span>
  <button class='btn btn--s visible-on-parent-hover'>Edit</button>
</div>
.bg-canvas.bg-canvas--dark

Fill an element with a checkerboard, for previewing transparent images and colors. On dark backgrounds, add the bg-canvas--dark modifier.

<div class='bg-canvas h60 mb12'></div>
<div class='bg-canvas bg-canvas--dark bg-gray-dark h60'></div>
.events-none

Disable touch and click events on an element and its children. Be aware that this rule does not disable keyboard events, so a user can still tab to an element and press Return to trigger its click event.

You can't click this
<div class='btn events-none'>You can't click this</div>
.events-all

Enable touch and click events on an element and its children. Use to re-enable such events inside a parent with the events-none class.

You can click this.
<div class='events-none'><div class='events-all'>You can click this.</div></div>
.unselectable

Disable text selection on an element and its children. Use only in cases where accidental text selection causes user frustration.

You can't select this.
<div class='unselectable'>You can't select this.</div>
.selectable

Enable text selection on an element and its children. Use to re-enable selection inside a parent with the unselectable class.

You can select this.
<div class='unselectable'><div class='selectable'>You can select this.</div></div>
.transition

Apply a subtle animated transition when changing CSS properties on an element. See MDN's list of CSS animated properties for every property effected by this class.

Hover over me
<div class='bg-blue-on-hover transition'>Hover over me</div>
.transition-none

Disable an animated transition on elements like btn that have default transitions.

transition-none
<div class='btn transition-none'>transition-none</div>
.overflow-scroll

Always show scrollbars.

Curabitur blandit tempus porttitor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Maecenas faucibus mollis interdum. Donec ullamcorper nulla non metus auctor fringilla. Nullam id dolor id nibh ultricies vehicula ut id elit.
<div class='overflow-scroll'>Curabitur blandit tempus porttitor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Maecenas faucibus mollis interdum. Donec ullamcorper nulla non metus auctor fringilla. Nullam id dolor id nibh ultricies vehicula ut id elit.</div>
.overflow-auto

Display scrollbars if content flows beyond the edge of the element.

Curabitur blandit tempus porttitor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Maecenas faucibus mollis interdum. Donec ullamcorper nulla non metus auctor fringilla. Nullam id dolor id nibh ultricies vehicula ut id elit.
<div class='h60 overflow-auto'>Curabitur blandit tempus porttitor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Maecenas faucibus mollis interdum. Donec ullamcorper nulla non metus auctor fringilla. Nullam id dolor id nibh ultricies vehicula ut id elit.</div>
.overflow-hidden

Hide content if it extends beyond the edge of the containing element.

Curabitur blandit tempus porttitor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Maecenas faucibus mollis interdum. Donec ullamcorper nulla non metus auctor fringilla. Nullam id dolor id nibh ultricies vehicula ut id elit.
<div class='h60 overflow-hidden'>Curabitur blandit tempus porttitor. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Maecenas faucibus mollis interdum. Donec ullamcorper nulla non metus auctor fringilla. Nullam id dolor id nibh ultricies vehicula ut id elit.</div>
.hide-visually

Hide an element visually, but keep it available to screen readers.

You cannot see this with your eyes.
There is a sentence above this that you cannot see.
<div class='hide-visually'>You cannot see this with your eyes.</div>
<div>There is a sentence above this that you cannot see.</div>
.none-print

Apply display none when rendering page for print.

<div class="none-print'>Hi, this text won't print!</div>