SB Playground

A showcase of demos, examples, and code snippets of one SB.
The source code for the site could be found here.

Auto Ribbon

An auto ribbon has elements that doesn't fill out the entire available space. Don't forget to add ribbon--alpha, ribbon--beta or ribbon--gamma modifier.

Modifier: .ribbon--auto.

The HTML structure:

<nav class="ribbon ribbon--alpha ribbon--auto" role="navigation" aria-label="breadcrumbs">
  <a class="ribbon__element" href="https://www.silvestar.codes/">Home</a>
  <a class="ribbon__element" href="https://www.silvestar.codes/categories/articles/">Blog</a>
  <a class="ribbon__element" href="https://www.silvestar.codes/articles/building-an-animated-sticky-header-with-custom-offset/" aria-current="page">Post</a>
</nav>

The CSS code:

/* Define full width ribbon elements */
.ribbon--auto {
  grid-template-columns: repeat(3, 1fr) 1em;
}

A ribbon component showed in these examples should be used as a breadcrumb element. However, if you want to use it for something else, be sure to update or remove the aria attributes. The HTML code for accessible breadcrumbs could be found on the A11y Style Guide website, under Option #2.

See the full list of ribbon modifiers below:

Powered by Starter Project.