Triangle Breadcrumb

by joseffriedrich

HTML

<ul class="breadcrumb">
  <li><a href="#">Antrag</a></li>
  <li><a href="#">Anzeigepflicht</a></li>
  <li><a href="#">Begutachtung</a></li>
  <li><a href="#">Ablehnung</a></li>
</ul>

SCSS

/* dark */
$green1: #005500;
$green2: #007700;
$green3: #00AA00;
$green4: #00CC00;
/* light */

$grey: #666666;

.breadcrumb {
    list-style: none;
    overflow: hidden;
    font: 18px Helvetica, Arial, Sans-Serif;
  li {
    float: left;
    a {
      color: white;
      text-decoration: none;
      padding: 10px 0 10px 55px;
      background: brown;
      /* fallback color */
      background: $green1;
      position: relative;
      display: block;
      float: left;
      &:after {
        content:" ";
        display: block;
        width: 0;
        height: 0;
        border-top: 50px solid transparent;
        /* Go big on the size, and let overflow hide */
        border-bottom: 50px solid transparent;
        border-left: 30px solid $green1;
        position: absolute;
        top: 50%;
        margin-top: -50px;
        left: 100%;
        z-index: 2;
      }
      &:before {
        content:" ";
        display: block;
        width: 0;
        height: 0;
        border-top: 50px solid transparent;
        /* Go big on the size, and let overflow hide */
        border-bottom: 50px solid transparent;
        border-left: 30px solid white;
        position: absolute;
        top: 50%;
        margin-top: -50px;
        margin-left: 1px;
        left: 100%;
        z-index: 1;
      }
    }
  }
  li:first-child a {
    padding-left: 10px;
  }
  li:nth-child(2) a {
    background: $green2;
    &:after {
      border-left-color: $green2;
    }
  }
  li:nth-child(3) a {
    background: $green3;
    &:after {
      border-left-color: $green3;
    }
  }
  li:last-child a {
    background: $green4;
    &:after {
      border-left-color: $green4;
    }
  }
  li a:hover {
    background: $grey;
    &:after {
      border-left-color: $grey !important;
    }
  }
}