Buttons

Buttons can be a or button elements. They can be modified with various classes.

If you are linking to a page or an anchor, use the a element.

Example:

<a class="tcu-button _primary" href="https://www.tcu.edu/apply.php">Apply</a>

If you are triggering an event with JavaScript, use the button element.

Example:

<button class="tcu-button _secondary">Expand Menu<button>

How to style a component button

Instead of using specific button classes like secondary or hollow in a component, style the button using button mixins and css custom properties. This allows us to be more flexible with button styles within components.

CSS Custom Properties:

  • –button-background
  • –button-color
  • –button-border-color
  • –button-border-width

Mixins:

  • primary-button
  • hover-button
  • secondary-button
  • hollow-button
  • clear-button

Example of a component with hollow buttons set with mixins:

<div class="tcu-component">
  ...
  <div class="button-group">
    <a href="#" class="button">Visit</a>
  </div>
</div>
  .tcu-component {
    @include hollow-button();
  }
<h2>Colors</h2>

<a href="#" class="button primary">
    Primary Button
</a>

<a href="#" class="button secondary">
    Secondary Button
</a>

<a href="#" class="button solid">
    Solid Button
</a>
<h2>Sizes</h2>

<a href="#" class="button expanded">
    Expanded Button
</a>

<a href="#" class="button small-only-expanded">
    Expanded on Mobile Only
</a>
<h2>Types</h2>

<a href="#" class="button hollow">
    Hollow Button
</a>

<a href="#" class="button clear">
    Clear Button
</a>

<a href="#" class="button icon">
    <svg height='30' width='30'>
        <use xmlns:xlink='https://www.w3.org/1999/xlink' xlink:href='#icon-facebook' href='#icon-facebook'></use>
    </svg>Icon Button
</a>