Skip navigation

W1N style guide

Home / W1N style guide

The Grid

This template system uses a fluid, mobile-first grid system powered by flexbox and based on simple fractions—halves, thirds, and fourths. It supports nesting, and includes special classes for offsets and content choreography.

The Base Grid

The .container class centers content on the page and restricts it to a maximum width.

To create a grid, add a div with a .row class. You can create grids within a row by creating div elements with the .grid-$size class. The .grid-auto class will scale the content to fit whatever space is available.

.grid-auto
.grid-auto
.grid-auto
.grid-auto
.grid-auto
.grid-third
.grid-two-thirds
.grid-fourth
.grid-three-fourths
.grid-half
.grid-half
.grid-full

Offsets

Push grids to the right by adding an .offset-$size class.

.grid-three-fourths .offset-fourth
.grid-third
.grid-third .offset-third

Alignment

Align content at the beginning of the row by adding the .row-start class, to the end of the row by adding the .row-end class, and in the center by adding the .row-center class.

.row-start > .grid-half
.row-center > .grid-half
.row-end > .grid-half

Align content at the top by adding the .row-top class, in the middle with the .row-middle class, and at the bottom with the .row-bottom class.


.row-top > .grid-third

.row-top > .grid-third

.row-top > .grid-third


.row-middle > .grid-third

.row-middle > .grid-third

.row-middle > .grid-third


.row-bottom > .grid-third

.row-bottom > .grid-third

.row-bottom > .grid-third

Grids on Small Screens

The grid activates on medium-sized screens by default. You can toggle the grid on smaller screens by adding a simple.row-start-xsmallor .row-start-small to the desired .row element.

Extra Small Screens

.grid-fourth
.grid-fourth
.grid-fourth
.grid-fourth

Small Screens

.grid-fourth
.grid-fourth
.grid-fourth
.grid-fourth

Content Choreography

You can flip the order of grid items on bigger screens with a series of helper classes. Add the .grid-first class to move content to the beginning of a row, and the .grid-last class to move it to the end. Add the .row-reverse class to reverse the entire order of content in a row.

1
2
3
1
2
3
1
2
3

Wrapping Grids

You can create grids that dynamically wrap content based on available spacing by adding the .row-wrap class and using the .grid-auto class. The content inside each grid also needs to have a width or max-width assigned to it.

placeholder graphic

placeholder graphic

placeholder graphic

placeholder graphic

placeholder graphic

placeholder graphic

placeholder graphic

placeholder graphic

placeholder graphic

placeholder graphic

placeholder graphic

placeholder graphic


Typography

This template system uses relative sizing (ems and %, not pixels) for everything.

The body has a base font-size of 100%, which is 16px on browsers with default font settings. All other sizes are in ems. Changing the font-size on the body element will adjust the typographical scale for the entire site.

Text Basics

Default text
Muted text
Small text
Large text
Hyperlinks
Bold, italics, and strikethrough
Highlighted text

Because this template system uses relative sizing, you should always apply .text-tall and .text-small classes to a element and not directly to a p. Otherwise, your spacing will get all messed up. The .text-* classes can be found in _overrides.scss for better cascade inheritance.


Lists

This template system includes styling for ordered, unordered, unstyled, inline, and definition lists.

Ordered
  1. Item 1
  2. Item 2
  3. Item 3
Unordered
  • Item 1
  • Item 2
  • Item 3
Unstyled
  • Item 1
  • Item 2
  • Item 3
Inline
Definition List
Encloses a list of pairs of terms and descriptions. Common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs).
Here’s another term
And here’s the definition that would go with it.

For semantic reasons, .list-unstyled and .list-inline should only be applied to unordered lists.

You can also include superscripts1 and subscriptsxyz.


Headings

This template system includes styling for h1 through h6 headings.

h1. Heading 1

h2. Heading 2

h3. Heading 3

Semantic Heading Classes

All heading values can also be applied as classes. For example, if a heading should be an h1 element semantically, but you would like it to be styled as an h4 element, you can apply class="h1" to the h3 element.

This is an h3 that's styled as an h1 heading.


Quotes & Citations

Someone once said something so important, it was deemed worthy of repeating here in the form of a blockquote. This is that blockquote. —Someone Important

Lines

Add lines to your markup using the hr element.


Colors

Site brand

bg-color-primary
bg-color2
bg-color3
bg-color4
bg-color5

State colors (used primarily for form validations)

bg-color-info
bg-color-success
bg-color-danger
bg-color-warning

Greyscale

bg-color-black
bg-color-dark-grey
bg-color-medium-grey
bg-color-light-grey

Buttons

Button styles can be applied to anything with the .btn class applied. However, typically you'll want to apply these to only a, button, and input type="submit" elements for the best rendering.

Basic Buttons

Active and Disabled Buttons

Use the .active class and [disabled] attribute to change the appearance of buttons—useful for creating apps.


Tables

This template system includes simple, easy-to-read table styling.

First NameLast NameSuper Hero
PeterParkerSpiderman
BruceWayneBatman
ClarkKentSuperman

Condensed Table

Add the .table-condensed class for more compact tables.

First NameLast NameSuper Hero
PeterParkerSpiderman
BruceWayneBatman
ClarkKentSuperman

Zebra Striping

Add zebra striping for easier readability with the .table-striped class.

First NameLast NameSuper Hero
PeterParkerSpiderman
BruceWayneBatman
ClarkKentSuperman

Forms

Labels, legends and inputs are styled as full width block elements (with the exception of checkboxes and radio buttons).

Basic Forms

Wrap checkboxes and radio buttons inside a

Condensed & Inline Inputs

For smaller forms, add the .input-condensed class to your input fields. For inline form elements, add the .input-inline class.

Search Forms

Apply special styling to search form elements using the .input-search and .btn-search classes. You'll also need to use the .input-inline class.


Alignment, Spacing & Visibility

You can adjust text alignment, spacing, and visibility using a few simple CSS classes.

Text Alignment

ClassAlignment
.text-leftLeft
.text-centerCentered
.text-rightRight
.text-left-smallLeft above 20em
.text-left-mediumLeft above 40em
.text-left-largeLeft above 60em
.text-left-xlargeLeft above 80em
.text-center-smallCentered above 20em
.text-center-mediumCentered above 40em
.text-center-largeCentered above 60em
.text-center-xlargeCentered above 80em
.text-right-smallRight above 20em
.text-right-mediumRight above 40em
.text-right-largeRight above 60em
.text-right-xlargeRight above 80em

Floats

ClassFloat
.float-leftLeft
.float-centerCentered
.float-rightRight

Clear floats by wrapping floated content in a div with the .clearfix class.

Margins

ClassMargin
.no-margin-toptop: 0
.no-margin-bottombottom: 0
.margin-toptop: 1.5625em
.margin-bottombottom: 1.5625em
.margin-bottom-smallbottom: 0.5em
.margin-bottom-largebottom: 2em

Padding

Classpadding
.no-padding-toptop: 0
.no-padding-bottombottom: 0
.padding-toptop: 1.5625em
.padding-top-smalltop: 0.5em
.padding-top-largetop: 2em
.padding-bottombottom: 1.5625em
.padding-bottom-smallbottom: 0.5em
.padding-bottom-largebottom: 2em

Visibility

Hide content using the [hidden] attribute.

If you have text that you don’t want displayed on screen, but that should still be in the markup for screen readers (for example, a search form label), simply apply the .visually-hidden class.