<h1>Beta ribbon</h1>
<nav class="ribbon ribbon--beta" role="navigation" aria-label="breadcrumbs">
  <a class="ribbon__element" href="https://www.silvestar.codes/" target="_blank">Home</a>
  <a class="ribbon__element" href="https://www.silvestar.codes/categories/articles/" target="_blank">Blog</a>
  <a class="ribbon__element" href="https://www.silvestar.codes/articles/building-an-animated-sticky-header-with-custom-offset/" aria-current="page" target="_blank">Post</a>
</nav>
<h3><a href="https://codepen.io/collection/DmwMyr/" target="_blank">A ribbon collection</a></h3>
<p><a href="https://www.silvestar.codes/" target="_blank">silvestar.codes</a> 🤘 <a href="https://play.silvestar.codes/ribbon/" target="_blank">SB Playground</a></p>
// Dirty reset
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

// Variables
$c0: #343435;
$c1: lighten(#0fba84, 5%);
$c2: lighten(#e01258, 10%);
$c3: lighten(#1ec9e4, 10%);
$c9: #fff;

// Global style
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: $c0;
  min-height: 100vh;
  padding: 10px;
  font-family: 'Barlow', sans-serif;
}

h1,
h3,
p {
  margin-top: 2em;
  
  a {
    color: $c2;
    text-decoration: none;
    
    &:hover {
      color: darken($c2, 10%);
      text-decoration: underline;
    }
  }
}

// Ribbon
.ribbon {
  display: grid;
  font-size: 15px;
  grid-gap: 1px;
  grid-template-columns: repeat(3, 1fr) 1em;
  margin-left: auto;
  margin-right: auto;
  margin-top: 1em;
  width: 100%;
}

.ribbon__element {
  background-color: $c1;
  color: $c9;
  font-size: 1.5em;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.333em;
  padding: 0.667em 0.667em 0.667em 1.333em;
  position: relative;
  text-decoration: none;

  &:nth-child(1) {
    background-color: $c1;
    z-index: 3;
  }

  &:nth-child(2) {
    background-color: $c2;
    z-index: 2;
  }

  &:nth-child(3) {
    background-color: $c3;
    z-index: 1;
  }

  .ribbon--beta & {
    &:before {
      background-image: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMTAgNDAiIHdpZHRoPSIxMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsPSIjZmZmIj48cGF0aCBkPSJtNSAxNSAyMCAxMGgtNDB6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0ibWF0cml4KDAgLTEgLTEgMCAyNSAyNSkiLz48L3N2Zz4=);
      background-position: center left;
      background-repeat: no-repeat;
      background-size: 100%;
      bottom: 0;
      content: '';
      height: 100%;
      left: 0;
      position: absolute;
      top: 0;
      width: 0.667em;
    }

    &:after {
      background-position: center left;
      background-repeat: no-repeat;
      background-size: 100%;
      bottom: 0;
      content: '';
      height: 100%;
      position: absolute;
      right: 0;
      top: 0;
      transform: translateX(0.667em);
      width: 0.667em;
    }

    &:nth-child(1) {
      &:after {
        background-image: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMTAgNDAiIHdpZHRoPSIxMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSAxNSAyMCAxMGgtNDB6IiBmaWxsPSIjMTFkMjk1IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0ibWF0cml4KDAgLTEgLTEgMCAyNSAyNSkiLz48L3N2Zz4=);
      }
    }

    &:nth-child(2) {
      &:after {
        background-image: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMTAgNDAiIHdpZHRoPSIxMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSAxNSAyMCAxMGgtNDB6IiBmaWxsPSIjZWYzNjc1IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0ibWF0cml4KDAgLTEgLTEgMCAyNSAyNSkiLz48L3N2Zz4=);
      }
    }

    &:nth-child(3) {
      &:after {
        background-image: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMTAgNDAiIHdpZHRoPSIxMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSAxNSAyMCAxMGgtNDB6IiBmaWxsPSIjNGNkNGU5IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0ibWF0cml4KDAgLTEgLTEgMCAyNSAyNSkiLz48L3N2Zz4=);
      }
    }
  }

  &:hover,
  &:active {
    color: inherit;
    text-decoration: underline;
  }
  
  &:focus {
    box-shadow: 0 -3px 0 0 $c0 inset;
    outline: none;
  }

  &:visited {
    color: $c9;
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.