Buttons

Link Buttons

Primary
Secondary
Tertiary
Disabled

Form Buttons


HTML

<!-- Link Button -->
<a href="#" class="button" role="button">Book Flight</a>

<!-- Form Buttons -->
<input type="button" class="button" value="Book Flight" role="button">
<button type="button" role="button">Book Flight</button>

<!-- Type Options -->
<a href="#" class="button secondary" role="button">Book Flight</a>
<a href="#" class="button tertiary" role="button">Book Flight</a>
<a href="#" class="button disabled" role="button">Book Flight</a>

<!-- Size Options -->
<a href="#" class="button medium" role="button">Book Flight</a>
<a href="#" class="button small secondary" role="button">Book Flight</a>
<a href="#" class="button hero" role="button">Book Flight</a>

<!-- 
	// Accessibility //
	- role: button
	- aria-label: use if no text, give a literal description of function
	- tabindex: default based on layout order, specify if necessary
-->
<a href="#" class="button" role="button" 
	aria-label="search for flights" tabindex="3">[icon]</a>

CSS

button, .button {
  display: inline-block;
  position: relative;
  width: 100%;
  /* small screen default */
  margin: 0 20px 16px 0;
  /* set line-height to same as font-size for centering */
  font-size: 16px;
  line-height: 16px;
  padding: 12px 20px;
  font-weight: normal;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  color: #ffffff;
  background-color: #78be20;
  cursor: pointer;
  border-style: solid;
  border-width: 0;
  -webkit-appearance: none;
  -webkit-border-radius: 0;
  transition: background-color 300ms ease-out;
}

button:hover, button:active, button:focus,
.button:hover, .button:active, .button:focus {
  color: #ffffff;
  background-color: #91da35;
}

button.medium, .button.medium {
  width: auto;
  margin-right: 10px;
  font-size: 14px;
  padding: 10px 15px;
}

button.small, .button.small {
  width: auto;
  margin-right: 5px;
  font-size: 10px;
  padding: 5px 10px;
  min-height: 20px;
}

button.secondary, .button.secondary {
  color: #ffffff;
  background-color: #8eabba;
}

button.secondary:hover, button.secondary:active, button.secondary:focus,
.button.secondary:hover, .button.secondary:active, .button.secondary:focus {
  color: #ffffff;
  background-color: #a8c8d9;
}

button.tertiary, .button.tertiary {
  color: #666666;
  background-color: #ffffff;
  border: 1px solid #848484;
  /* account for border */
  padding: 11px 19px;
}

button.tertiary.medium, .button.tertiary.medium {
  /* account for border */
  padding: 9px 14px;
}

button.tertiary.small, .button.tertiary.small {
  /* account for border */
  padding: 4px 9px;
}

button.tertiary:hover, button.tertiary:active, button.tertiary:focus,
.button.tertiary:hover, .button.tertiary:active, .button.tertiary:focus {
  color: #666666;
  background-color: #dddddd;
}

button.disabled, .button.disabled,
button.disabled:hover, button.disabled:active, .button.disabled:hover,
button.disabled:focus, button.disabled:active, .button.disabled:focus {
  opacity: 1;
  /* iOS set <1 opacity on input */
  background-color: #cccccc;
  color: #ffffff;
  cursor: default;
  pointer-events: none;
  /* use js polyfill for IE and SVG links */
}

button.hero, .button.hero {
  padding-top: 18px;
  padding-bottom: 16px;
  padding-left: 40px;
  padding-right: 40px;
}

/* medium screens and up */
@media screen and (min-width: 40.063em) {
  button, .button {
    width: auto;
  }
}