Buttons

Creating Buttons

Link styled as a button

Disabling Buttons

Link styled as a button (link still works)

A link styled as a button can only appear disabled by assigning the disabled class. The link will still work. HTML links do not support a disabled attribute.


ButtonGroup

Place a group of buttons in a buttonGroup container. ButtonGroup changes to a column layout responsively.

Further control of the button layout is possible with additional classes:

When paired with an action button (ex: Cancel / Save), use a buttonGroup container, and make the red action a ghost or flat style button.

Place the committing action last (to the right/bottom).


Standard, Ghost, and Flat Buttons

Standard Button

Standard buttons have a border and background. Most buttons are standard buttons.

Ghost Button

Ghost buttons have a border but no background. They are for alternative, secondary, and non-urgent actions.

For example, on a login form, "Log In" is the primary action while "Register" is a secondary action.

Flat Button

Flat buttons may be used in-tandem with a primary action inside a buttonGroup container.

For example, in a cancel/save combo, the cancel button is a flat button.

Ghost or Flat?

  • Use a ghost button when presenting multiple parallel choices (make the most likely option a standard button)
  • Use a flat button when presenting an either/or choice (ex: you can save or you can cancel)

BLUE Buttons: Non-Committing Actions; Links; Modal & Intermediary Steps

Use blue buttons for non-committing actions like links to products or other content. Think of a blue button as a regular link, but with more visual importance.

Calls to action like 'Buy This Product' or 'Sign Up' could be blue or green buttons. Use the following as a guide:

Tiny

Default
Ghost
Flat

Small

Default
Ghost
Flat

Regular

Default
Ghost
Flat

Large

Default
Ghost
Flat

GREEN Buttons: Primary & Committing Actions

Use green buttons for commiting actions like adding an item to a cart, submitting a form, or completing a task. Generally, tapping a green button will lead to a result like a confirmation page, results of a report, or a next step.

A page should usually only have one green button. Modal windows are committed with a blue button. Semantic submit buttons should always be green.

Calls to action like 'Buy This Product' or 'Sign Up' could be blue or green buttons. Use the following as a guide:

Tiny

Default
Ghost
Flat

Small

Default
Ghost
Flat

Regular

Default
Ghost
Flat

Large

Default
Ghost
Flat

RED Buttons: Cancel or Destructive Actions

Use red buttons for canceling, aborting, or deleting actions. A user should approach a red button with caution.

When paired with an action button (ex: Cancel / Save), use a buttonGroup

Tiny

Default
Ghost
Flat

Small

Default
Ghost
Flat

Regular

Default
Ghost
Flat

Large

Default
Ghost
Flat

Standard Button With Icon





This "Download Something" button also has a specific class that overrides the default svg size for just this button.

Left/Right Aligned Flex Buttons

Sometimes buttons with icons look better when their content is aligned to the left so that the icons line up.

Aligning content to the left or right only works with flex buttons. Most of the time, button content should be centered.



Button Width

By default, buttons have a min-width and left+right padding. This can prevent a flat button from looking like it's "flush left." To disable min-width and padding, use:

  • noPaddingX
  • noMinWidth
The same flat flex button with noPaddingX and noMinWidth.

To make a button full-width in its container, use:

  • fullWidth

Lorem ipsum dolor sit amet consec tetur adipi sicing elit. Dolores tenetur animi, exercit ationem quam itaque numquam facilis incidunt at unde quis soluta sed quidem nam saepe distinctio? Id saepe autem neque facilis ab.

This "Schedule Event" button has the class fullWidth to set the width property = 100% of container's width.
Button With Icon
<button class='button blue flex'> <?= preg_replace("/{{class-name}}/", "importIcon", file_get_contents("../images/icons/import.svg")); ?> <div>Button With a pretty Icon</div> </button>
Optional SCSS: Change the size of the svg icon
.button { &.specificStylingClass { svg { width: 24px; height: 24px; } } }

Just an Icon Buttons

HTML: Just an Icon
<button class='button reset specificStylingClass'> <?= preg_replace("/{{class-name}}/", "importIcon", file_get_contents("../images/icons/import.svg")); ?> </button>
SCSS: Just an Icon
.specificStylingClass { svg { width: $buttonHeight; height: $buttonHeight; fill: $orange; transition: all $transitionDuration; path { transition: all $transitionDuration; } } &:hover { svg { path#box { fill: $purple; } path#arrow { fill: $green; } } } }

Marker Flags: Like a Skinny Post-it© Page Marker

The class .markerFlag replaces the deprecated @mixin edit-this-flag that is still used in WordPress but no where else.

Marker flags don't have to be links, but they often will be.

Page Marker Link

Page Marker Flag

Depending on the page, marker flags might work best with a negative left margin so they stick to the left edge of the window (outside of the article's boundary).

The negative left margin is not part of the .markerFlag class. You'll need to extend the class with the negative margin.


Tag Cloud Links

Tags are presented as links inside <li class='tag'> children of a <ul class='reset tags'> container.

HTML: tag cloud
<ul class='tags'> <li class='tag'><a href=''>Apples</a></li> <li class='tag'><a href=''>Oranges</a></li> <li class='tag'><a href=''>Kiwis</a></li> </ul>

Subtle Buttons

Subtle buttons are for links that need just a little bit of sparkle-dust (not for actions). For example: A blog author's name that links to their entire collection of posts, or individual tags in a tag cloud might be a subtle button.

The subtle button is also used as the base for the deprecated edit-this-flag styles, as well as the base for tags in a tag cloud.