Styleguide

Examples of all CSS components and configuration.

ButtonsColorsFormsGridIconsImagesLayoutLinksListsPopupTypographyVideoWidgets

Buttons

Button

Use to create buttons. Buttons come in various sizes and colors. Add more colors and customize your buttons in config/button.scss. You can also use @include button;

Example

Example Code

<p>
    <a href="#" class="button">I'm a normal button</a>
</p>
<p>
    <button class="button--ghost">Button elements don't need the button class</button>
</p>
<p>
    <input type="submit" value="Submit inputs do though" class="button button--disabled"
        disabled>
</p>
<p>
    <a href="#" class="button">Continue</a>
    <a href="#" class="button button--gray button--ghost">Cancel</a>
</p>
<p>
    <a href="#" class="button button--gradient">Button colors can be a list</a>
</p>
<p>
    <a href="#" class="button button--white">Bright buttons don't get white text</a>
</p>

Colors

Background Colors

Use to apply a background color to an element. Add your colors to the $bg-colors array in config/bg-colors.scss.

Example

Example Code

<div class="bg--white">I have a white background color</div>

Text Colors

Use to give an element's text a different color. This class affects everything, including headings and links.

Example

Example Code

<div class="bg--lightgray color--white">
    <h2>I have white</h2>
    <p>Text and
        <a href="#">links</a>
    </p>
</div>

Forms

Floating Label

Use to create labels that act as placeholders until the field is focused. Note that the field must also have a placeholder

Example

Example Code

<p class="floating-label">
    <input type="email" name="email" id="styleguide-placeholder-label-example"
        placeholder="This wont be shown but is required" required>
    <label for="styleguide-placeholder-label-example">E-mail</label>
</p>

Forms

Form styling.

Example

Example Code

<form method="post" action="">
    <p>
        <label> Search
            <br>
            <input type="search" name="q" placeholder="Search the site"> </label>
    </p>
    <p>
        <label> Name
            <br>
            <input type="text" name="name" placeholder="eg. John Doe"> </label>
    </p>
    <p>
        <label> Email
            <abbr title="Required">*</abbr>
            <br>
            <input type="email" name="email" placeholder="eg. john.doe@example.com"
                required> </label>
    </p>
    <p>
        <label> Sex
            <br>
            <select name="sex">
                <option value="f">Female</option>
                <option value="m">Male</option>
            </select>
        </label>
    </p>
    <p> Smoker?
        <br>
        <label>
            <input type="radio" name="smoker" value="1"> Yes</label>
        <label>
            <input type="radio" name="smoker" value="0"> No</label>
    </p>
    <p>
        <label>
            <span class="value">${age}</span> Age
            <br>
            <input type="range" name="age" min="1" max="150"> </label>
        <strong class="error">You have to be at least 18 to conitnue</strong>
    </p>
    <p>
        <label> Message
            <br>
            <textarea name="message" rows="3" cols="60" placeholder="Write your message here"></textarea>
        </label>
    </p>
    <p>
        <label>
            <input type="checkbox" name="agree"> I agree</label>
    </p>
    <p>
        <input type="submit" value="Go" class="button button--wide">
    </p>
</form>

Grid

Flex

Use to align elements in rows and columns. Perfect for use on ul/li setups or indeed any parent/child markup. Use bp--modifiers to set number of columns in different widths. Customize gutter and breakpoints in config file. You can also use ul {@include flex-grid(3)}.

Example

Example Code

<ul class="flex--2--tablet flex--3--laptop">
    <li>
        <img src="http://placehold.it/320x240" class="img--wide"> I'm two columns</li>
    <li>
        <img src="http://placehold.it/320x240" class="img--wide"> In low resolution</li>
    <li>
        <img src="http://placehold.it/320x240" class="img--wide"> But three columns</li>
    <li>
        <img src="http://placehold.it/320x240" class="img--wide"> In high</li>
    <li>
        <img src="http://placehold.it/320x240" class="img--wide"> Resolutions</li>
    <li>
        <img src="http://placehold.it/320x240" class="img--wide"> Cool?</li>
</ul>

Inline Grid

Uses inline-block to create a grid. Useful if you dynamically toggle elemens in the grid and need them to adapt to new positions. Note that @inline-grid sets the child element's font-size back to $font-size-default.

Example

Example Code

<ul class="inline-grid inline-grid--2--tablet">
    <li>Two column grid</li>
    <li>Two column grid</li>
    <li>Two column grid</li>
    <li>Two column grid</li>
</ul>

Icons

Icon

Use to add icons to elements. Icons added to empty elements will have zero spacing around them whereas icons added to elements with content will have some spacing. Add icons to the icons.json file (using fontello.com) and Gulp takes care of the rest.

Example

Example Code

<p>
    <a href="#" class="icon-facebook">Facebook</a>
    <a href="#" class="icon-twitter">Twitter</a>
    <a href="#" class="icon-facebook" title="Facebook"></a>
    <a href="#" class="icon-twitter" title="Twitter"></a>
    <button class="icon-search">Find</button>
    <a href="#" class="icon-right icon--after">Icon after text</a>
</p>

Images

Figure Background

Allows you to use a figure element (and its img) as a background image.

Example

Example Code

<header class="color--white" style="position:relative; overflow:hidden">
    <p>My background image is actually an img</p>
    <p>Note that the styleguide example containers have a background
        of their own which shines through here - make sure you
        _don't_ have a background when you use this component
        and it will look good</p>
    <figure class="figure-background">
        <img src="http://placehold.it/1920x1080">
    </figure>
</header>

Images

Various helper classes for styling images.

Example

Example Code

<img src="http://placehold.it/100x100" class="img--round">
<img src="http://placehold.it/100x100" class="img--rounded">
<img src="http://lorempixel.com/800/600/nature" class="img--grayscale img--wide">

Layout

Container

Centers an element on the screen at a width of $site-width. Containers should be direct decendants of body/main (any full width element actually) and don't work properly when nested like this. You can also use @include container and pass an optional width;

Example

Example Code

<div class="container bg--white">
    <h1>I'm centered</h1>
    <p>In the middle of the page</p>
</div>

Divider

Use to separate elements with a border. Can be used on a single element (or hr), or using --above or --below modifiers.

Example

Example Code

<p class="divider--below">I have a separator below me.</p>
<p>I'm just a normal paragraph</p>
<p class="divider--above">I have a separator above me.</p>
<p>Below me is a lone divider</p>
<hr>

Group

Use this class to add margin-bottom to an element.

Example

Example Code

<div class="card bg--white group--x-large">
    <h2>I have margin</h2>
    <p>More than usual</p>
</div>

Hero

A full width section with loads of padding and white text. This is a typical UI component in modern websites and is often displayed at the top of the page.

Example

Example Code

<header class="hero">
    <h2>I'm a hero</h2>
    <p>With some content</p>
    <figure>
        <img src="http://placehold.it/1920x1080">
    </figure>
</header>

Section

Creates a full width section with centered content (based on $site-width). Sections should be direct decendants of body/main (any full width element actually) and don't work properly nested like in the styleguide (that's why it looks broken here).

Example

Example Code

<div class="section bg--white">
    <h2>I'm a section</h2>
    <p>With some content</p>
</div>

Shadows

Use to apply a shadow to an element. Add your shadows to the $shadows array in config/shadows.scss.

Example

Example Code

<div class="bg--white shadow--4">I have a white background color and a level 4 shadow</div>

Lists

List

Various classes you can use on lists, or list like markup.

Example

Example Code

<h2>Pipe separated</h2>
<ul class="list--pipe-separated">
    <li>Pipes</li>
    <li>Separate</li>
    <li>Me</li>
</ul>
<h2>Inline list</h2>
<ul class="list--inline text--center">
    <li>Inline list</li>
    <li>Inline list</li>
    <li>Inline list</li>
    <li>Inline list</li>
</ul>
<h2>Plain list</h2>
<ul class="list--plain">
    <li>Plain list</li>
    <li>Plain list</li>
    <li>Plain list</li>
    <li>Plain list</li>
</ul>
<h2>Bordered list</h2>
<ul class="list--border">
    <li>Bordered list</li>
    <li>Bordered list</li>
    <li>Bordered list</li>
    <li>Bordered list</li>
</ul>

Popup

Popup

Use to create a popup. Works well with popup.js but isn't necessarily required.

Example

Example Code

<a href="#my-popup">Open popup</a>
<div class="popup" id="my-popup">
    <div class="popup__content">
        <a href="#" class="popup__close">&times;</a>
        <h2>I'm a popup</h2>
        <p>Built with CSS.</p>
    </div>
</div>

Typography

Headings

Use to create headings. H1-H6 automatically get the correct styling, however you can use the heading--X classes to make non-headings look like headings, and headings of one size appear to have a different size. You can also use @include heading;

Example

Example Code

<h1>I'm an H1</h1>
<h2>I'm an H2</h2>
<h3>I'm an H3</h3>
<h4>I'm an H4</h4>
<h5>I'm an H5</h5>
<h6>I'm an H6</h6>
<p class="heading--1">I'm a paragraph</p>

Text

Various helper classes for working with text.

Example

Example Code

<p class="text--center">This text is centered and
    <strong class="text--upper">upper case</strong>
</p>
<p class="text--right text--large">This large text is right aligned.</p>
<p class="text--ellipsis">Regardless of how long this text gets it will never line break
    regardless of how long this text gets it will never line
    break etc etc.</p>

Video

Video

Wrapping class for responsive, embedded videos (from https://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php)

Example

Example Code

<div class="video">
    <iframe width="560" height="315" src="https://www.youtube.com/embed/JSuYuPz0dlU"
        frameborder="0" allowfullscreen></iframe>
</div>

Widgets

Google Map

Use to render a Google Map.

Example

Example Code

<div class="google-map" data-lat="40.7058253" data-lng="-74.1180864">
    <img src="https://maps.googleapis.com/maps/api/staticmap?maptype=roadmap&amp;center=40.7058253,-74.1180864&amp;markers=40.7058253,-74.1180864&amp;zoom=14&amp;size=600x400&amp;key=GOOGLE_MAPS_API_KEY"> </div>

Slideshow

Styling for the Slick Carousel jQuery Plugin.

Example

Example Code

<div data-slideshow="3">
    <div>Slide 1</div>
    <div>Slide 2</div>
    <div>Slide 3</div>
    <div>Slide 4</div>
    <div>Slide 5</div>
    <div>Slide 6</div>
</div>