Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="page-wrap">
  
  <header class="main-header">
    <a class="logo" href="#0">
      <svg width="32" height="32" viewBox="0 0 24 24">
        <path d="M16.23,18L12,15.45L7.77,18L8.89,13.19L5.16,9.96L10.08,9.54L12,5L13.92,9.53L18.84,9.95L15.11,13.18L16.23,18M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z" />
      </svg>
    </a>
    
    <form class="search">
      <label for="search">Search</label>
      <input id="search" name="search" type="search">
      <button class="submit" type="submit">
        <svg width="24" height="24" viewBox="0 0 24 24">
          <path d="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z" />
        </svg>
      </button>
    </form>
    
    <nav class="main-nav">
      <ul class="primary-nav">
        <li><a href="#0">Home</a></li>
        <li><a href="#0">About</a></li>
        <li><a href="#0">Contact</a></li>
      </ul>
      
      <ul class="secondary-nav">
        <li><a href="#0">Log in</a></li>
        <li><a class="button primary" href="#0">Sign up</a></li>
      </ul>
    </nav>
  </header>
  
  <mian class="main-content">
    <section class="article-wrap">
      <article class="article">
        <img class="article-thumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=" alt="">
        
        <div class="content">
          <h2 class="title"><a href="#0">Lorem Ipsum Dolor</a></h2>
          <p class="text">Modi omnis atque ipsam libero officia, magni iure neque quas aliquam voluptatum suscipit, excepturi fugiat. In quam voluptatum vel, dignissimos aliquam earum.</p>
          
          <div class="actions">
            <a class="button secondary" href="#0">Read more</a>
            <a href="#0">Comments</a>
          </div>
        </div>
      </article>
      
      <article class="article">
        <img class="article-thumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=" alt="">
        
        <div class="content">
          <h2 class="title"><a href="#0">Dolor Sit Amet</a></h2>
          <p class="text">Repudiandae aperiam et hic id. Cupiditate modi ipsam totam, cumque suscipit, dicta vero ea eligendi rem aut impedit tenetur deleniti mollitia exercitationem.</p>
          
          <div class="actions">
            <a class="button secondary" href="#0">Read more</a>
            <a href="#0">Comments</a>
          </div>
        </div>
      </article>
      
      <article class="article">
        <img class="article-thumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=" alt="">
        
        <div class="content">
          <h2 class="title"><a href="#0">Lorem Ipsum Dolor</a></h2>
          <p class="text">Modi omnis atque ipsam libero officia, magni iure neque quas aliquam voluptatum suscipit, excepturi fugiat. In quam voluptatum vel, dignissimos aliquam earum.</p>
          
          <div class="actions">
            <a class="button secondary" href="#0">Read more</a>
            <a href="#0">Comments</a>
          </div>
        </div>
      </article>
      
      <article class="article">
        <img class="article-thumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=" alt="">
        
        <div class="content">
          <h2 class="title"><a href="#0">Dolor Sit Amet</a></h2>
          <p class="text">Repudiandae aperiam et hic id. Cupiditate modi ipsam totam, cumque suscipit, dicta vero ea eligendi rem aut impedit tenetur deleniti mollitia exercitationem.</p>
          
          <div class="actions">
            <a class="button secondary" href="#0">Read more</a>
            <a href="#0">Comments</a>
          </div>
        </div>
      </article>
      
      <footer class="main-footer">
        <p class="legal">&copy; All rights reserved.</p>
      </footer>
    </section>
    
    <aside class="sidebar">
      <div class="sidebar-content">
        <h3 class="title">Sidebar Links</h3>
        
        <ul class="sidebar-nav">
          <li class="active"><a href="#0">Sidebar-Link One</a></li>
          <li><a href="#0">Sidebar-Link Two</a></li>
          <li><a href="#0">Sidebar-Link Three</a></li>
          <li><a href="#0">Sidebar-Link Four</a></li>
          <li><a href="#0">Sidebar-Link Five</a></li>
        </ul>

        <h3 class="title">More Links</h3>
        
        <ul class="sidebar-nav">
          <li><a href="#0">Sidebar-Link Six</a></li>
          <li><a href="#0">Sidebar-Link Seven</a></li>
          <li><a href="#0">Sidebar-Link Eight</a></li>
          <li><a href="#0">Sidebar-Link Nine</a></li>
          <li><a href="#0">Sidebar-Link Ten</a></li>
        </ul>
        
        <div class="actions">
          <a class="button tertiary" href="#0">Sidebar Button</a>
        </div>
      </div>
    </aside>
  </mian>
</div>

<div class="controls-wrap">
  <button class="controls-toggle">
    <svg width="24" height="24" viewBox="0 0 24 24">
      <path d="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z" />
    </svg>
  </button>
  
  <div class="controls">
    <h2 class="title">Color Theme</h2>

    <fieldset class="primary-color">
      <h3 class="subtitle">Primary Color</h3>

      <div class="form-element">
        <label for="primary-red">Red</label>
        <input id="primary-red" class="range red" name="primary-red" type="range" min="0" max="255">
      </div>

      <div class="form-element">
        <label for="primary-green">Green</label>
        <input id="primary-green" class="range red" name="primary-green" type="range" min="0" max="255">
      </div>

      <div class="form-element">
        <label for="primary-blue">Blue</label>
        <input id="primary-blue" class="range blue" name="primary-blue" type="range" min="0" max="255">
      </div>
    </fieldset>

    <fieldset class="secondary-color">
      <h3 class="subtitle">Secondary Color</h3>

      <div class="form-element">
        <label for="secondary-red">Red</label>
        <input id="secondary-red" class="range red" name="secondary-red" type="range" min="0" max="255">
      </div>

      <div class="form-element">
        <label for="secondary-green">Green</label>
        <input id="secondary-green" class="range red" name="secondary-green" type="range" min="0" max="255">
      </div>

      <div class="form-element">
        <label for="secondary-blue">Blue</label>
        <input id="secondary-blue" class="range blue" name="secondary-blue" type="range" min="0" max="255">
      </div>
    </fieldset>

    <fieldset class="tertiary-color">
      <h3 class="subtitle">Tertiary Color</h3>

      <div class="form-element">
        <label for="tertiary-red">Red</label>
        <input id="tertiary-red" class="range red" name="tertiary-red" type="range" min="0" max="255">
      </div>

      <div class="form-element">
        <label for="tertiary-green">Green</label>
        <input id="tertiary-green" class="range red" name="tertiary-green" type="range" min="0" max="255">
      </div>

      <div class="form-element">
        <label for="tertiary-blue">Blue</label>
        <input id="tertiary-blue" class="range blue" name="tertiary-blue" type="range" min="0" max="255">
      </div>
    </fieldset>

    <fieldset class="quaternary-color">
      <h3 class="subtitle">Quaternary Color</h3>

      <div class="form-element">
        <label for="quaternary-red">Red</label>
        <input id="quaternary-red" class="range red" name="quaternary-red" type="range" min="0" max="255">
      </div>

      <div class="form-element">
        <label for="quaternary-green">Green</label>
        <input id="quaternary-green" class="range red" name="quaternary-green" type="range" min="0" max="255">
      </div>

      <div class="form-element">
        <label for="quaternary-blue">Blue</label>
        <input id="quaternary-blue" class="range blue" name="quaternary-blue" type="range" min="0" max="255">
      </div>
    </fieldset>
  </div>
</div>
              
            
!

CSS

              
                /* Global Vars */

:root {
  --primary-red: 40;
  --primary-green: 120;
  --primary-blue: 255;
  
  --secondary-red: 255;
  --secondary-green: 20;
  --secondary-blue: 70;
  
  --tertiary-red: 20;
  --tertiary-green: 25;
  --tertiary-blue: 30;
  
  --quaternary-red: 40;
  --quaternary-green: 50;
  --quaternary-blue: 55;
}


/* Reset */

html {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
  padding: 0;
  margin: 0;
}

fieldset {
  border: none;
}


/* Global Stlyes */

body {
  --accessible-color: calc(
    (
      (
        (
          (var(--quaternary-red) * 299) +
          (var(--quaternary-green) * 587) +
          (var(--quaternary-blue) * 114)
        ) / 1000
      ) - 128
    ) * -1000
  );
  overflow-x: hidden;
  color: #fff; /* Fallback */
  color:
    rgb(
      var(--accessible-color),
      var(--accessible-color),
      var(--accessible-color)
    );
  font-size: 1em;
  line-height: 1.375;
  font-family: Lato, sans-serif;
  background-color: #333;  /* Fallback */
  background-color:
    rgb(
      var(--quaternary-red),
      var(--quaternary-green),
      var(--quaternary-blue)
    );
}

h1 {
  margin-bottom: 1rem;
  font-weight: bold;
  font-size: 2em;
}

h2 {
  margin-bottom: 1rem;
  font-weight: bold;
  font-size: 1.5em;
}

h3 {
  margin-bottom: 1rem;
  font-weight: bold;
  font-size: 1em;
  text-transform: uppercase;
}

p {
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.25rem;
}

.page-wrap {
  display: flex;
  flex-direction: column;
}


/* Buttons / Links */

a {
  --red: var(--primary-red);
  --green: var(--primary-green);
  --blue: var(--primary-blue);
  color: inherit;  /* Fallback */
  color:
    rgb(
      var(--red),
      var(--green),
      var(--blue)
    );
}

a:not(.button):hover {
  color: inherit;
}

.button {
  --red: 50;
  --green: 50;
  --blue: 50;
  --accessible-color: calc(
    (
      (
        (
          (var(--red) * 299) +
          (var(--green) * 587) +
          (var(--blue) * 114)
        ) / 1000
      ) - 128
    ) * -1000
  );
  appearance: none;
  display: inline-block;
  position: relative;
  padding: 0.5em 1em;
  color: #fff; /* Fallback */
  color:
    rgb(
      var(--accessible-color),
      var(--accessible-color),
      var(--accessible-color)
    );
  line-height: 1;
  font-size: 0.875em;
  text-decoration: none;
  background-color: rgba(0,0,0,0.85); /* Fallback */
  background-color:
    rgb(
      var(--red),
      var(--green),
      var(--blue)
    );
  border-radius: 1.5em;
}

.button:hover {
  background-image: 
    linear-gradient(
      rgba(
        calc(var(--accessible-color) * -1),
        calc(var(--accessible-color) * -1),
        calc(var(--accessible-color) * -1),
        0.25
      ),
      rgba(
        calc(var(--accessible-color) * -1),
        calc(var(--accessible-color) * -1),
        calc(var(--accessible-color) * -1),
        0.25
      )
    );
}

.button.primary {
  --red: var(--primary-red);
  --green: var(--primary-green);
  --blue: var(--primary-blue);
  background-color:
    rgb(
      var(--primary-red),
      var(--primary-green),
      var(--primary-blue)
    );
}

.button.secondary {
  --red: var(--secondary-red);
  --green: var(--secondary-green);
  --blue: var(--secondary-blue);
  background-color:
    rgb(
      var(--secondary-red),
      var(--secondary-green),
      var(--secondary-blue)
    );
}

.button.tertiary {
  --red: var(--tertiary-red);
  --green: var(--tertiary-green);
  --blue: var(--tertiary-blue);
  background-color:
    rgb(
      var(--tertiary-red),
      var(--tertiary-green),
      var(--tertiary-blue)
    );
}

.button.quaternary {
  --red: var(--quaternary-red);
  --green: var(--quaternary-green);
  --blue: var(--quaternary-blue);
  background-color:   rgb(
      var(--quaternary-red),
      var(--quaternary-green),
      var(--quaternary-blue)
    );
}


/* Forms */

label {
  padding: 0.5em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"] {
  appearance: none;
  padding: 0.5em;
  font-size: inherit;
  font-family: inherit;
  background-color: #fff;
  border: 1px solid rgba(0,0,0,0.3);
}

button.submit {
  appearance: none;
  min-height: 2.1875em;
  padding: 0 0.5em;
  color: #fff;
  font-size: inherit;
  font-family: inherit;
  background-color: #333;
  border: none;
  cursor: pointer;
}


/* Mian Header */

.main-header {
  --accessible-color: calc(
    (
      (
        (
          (var(--quaternary-red) * 299) +
          (var(--quaternary-green) * 587) +
          (var(--quaternary-blue) * 114)
        ) / 1000
      ) - 128
    ) * -1000
  );
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-image: 
    linear-gradient(
      rgba(
        calc(var(--accessible-color) * -1),
        calc(var(--accessible-color) * -1),
        calc(var(--accessible-color) * -1),
        0.4
      ),
      rgba(
        calc(var(--accessible-color) * -1),
        calc(var(--accessible-color) * -1),
        calc(var(--accessible-color) * -1),
        0.4
      )
    );
}

.main-header > * {
  padding: 1.5rem;
}

.main-header a:not(.button) {
  color: inherit;
  opacity: 0.8;
}

.main-header a:not(.button):hover {
  opacity: 1;
}

.main-header .logo svg {
  display: block;
  fill: currentColor;
}

.main-header .search {
  --red: 255;
  --green: 255;
  --blue: 255;
  --accessible-color: calc(
    (
      (
        (
          (var(--red) * 299) +
          (var(--green) * 587) +
          (var(--blue) * 114)
        ) / 1000
      ) - 128
    ) * -1000
  );
  display: flex;
  align-items: center;
  flex: 1 1;
  max-height: 3em;
  padding: 0;
  color: #000; /* Fallback */
  color:
    rgb(
      var(--accessible-color),
      var(--accessible-color),
      var(--accessible-color)
    );
  background-color: #fff; /* Fallback */
  background-color:
    rgb(
      var(--red),
      var(--green),
      var(--blue)
    );
  border-radius: 0.25em;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}

.main-header .search > * {
  opacity: 0.75;
}

.main-header .search label {
  border-right: 1px solid rgba(0,0,0,0.3);
}

.main-header .search input {
  flex: 1 1;
  width: 100px;
  background-color: transparent;
  border: 0;
}

.main-header .search .submit {
  color: inherit;
  background-color: transparent;
}

.main-header .search .submit svg {
  display: block;
  fill: currentColor;
}

.main-nav {
  display: flex;
  align-items: center;
}

.main-nav > * {
  list-style: none;
  display: flex;
  align-items: center;
  margin-left: 1.5rem;
}

.main-nav > ul > li {
  margin-left: 1rem;
}

@media (max-width: 820px) {
  .primary-nav {
    display: none;
  }
}

@media (max-width: 550px) {
  .main-header .search {
    display: none;
  }
}


/* Main Content */

.main-content {
  display: flex;
  flex-flow: row-reverse;
  justify-content: center;
}

@media (max-width: 550px) {
  .main-content {
    display: block;
  }
}


/* Sidebar */

.sidebar-content {
  min-width: 220px;
  padding: 1.5rem 0;
}

@media (min-height: 580px) {
  .sidebar-content {
    position: sticky;
    top: 0;
  }
}

.sidebar .actions {
  margin-bottom: 1rem;
}

.sidebar-nav {
  list-style: none;
  margin-bottom: 2rem;
}

.sidebar .title,
.sidebar li {
  padding: 0.25rem 1.5rem;
}

.sidebar li.active {
  --accessible-color: calc(
    (
      (
        (
          (var(--primary-red) * 299) +
          (var(--primary-green) * 587) +
          (var(--primary-blue) * 114)
        ) / 1000
      ) - 128
    ) * -1000
  );
  color: #fff; /* Fallback */
  color:
    rgb(
      var(--accessible-color),
      var(--accessible-color),
      var(--accessible-color)
    );
  background-color: rgba(0,0,0,0.9); /* Fallback */
  background-color:
    rgb(
      var(--primary-red),
      var(--primary-green),
      var(--primary-blue)
    );
}

.sidebar a:not(.button) {
  display: block;
  color: inherit;
  text-decoration: none;
  opacity: 0.85;
}

.sidebar a:not(.button):hover {
  opacity: 1;
}

.sidebar .button {
  margin: 0 1.5em;
}


/* Articles */

.article-wrap {
  --accessible-color: calc(
    (
      (
        (
          (var(--primary-red) * 299) +
          (var(--primary-green) * 587) +
          (var(--primary-blue) * 114)
        ) / 1000
      ) - 128
    ) * -1000
  );
  flex: 1 0;
  padding: 1.5rem;
  color: #000; /* Fallback */
  color:
    rgb(
      calc(var(--accessible-color) * -1),
      calc(var(--accessible-color) * -1),
      calc(var(--accessible-color) * -1)
    );
  background-color: #fff; /* Fallback */
  background-color:
    rgb(
      var(--accessible-color),
      var(--accessible-color),
      var(--accessible-color)
    );
}

.article {
  display: flex;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  box-shadow: inset 0 -1px rgba(255,255,255,0.1);
}

.article-thumb {
  display: block;
  width: 100%;
  min-width: 120px;
  max-width: 240px;
  height: 100%;
  margin-right: 1rem;
  color: #333; /* Fallback */
  color:
    rgb(
      var(--quaternary-red),
      var(--quaternary-green),
      var(--quaternary-blue)
    );
  background-color: #000;
  border: 0.5em solid;
}

.article .content {
  max-width: 40em;
}

.article .actions {
  margin-top: 1rem;
}

.article .actions > * {
  margin-right: 0.5rem;
}

@media (max-width: 650px) {
  .article {
    display: block;
  }
  
  .article-thumb {
    max-width: none;
    height: auto;
    margin-bottom: 0.75rem;
  }
}

@media (max-width: 550px) and (min-width: 470px) {
  .article-wrap {
    display: flex;
    flex-wrap: wrap;
    padding: 0.75rem;
  }
  
  .article {
    flex: 1 1 50%;
    padding: 0.75rem 0.75rem 1.5rem;
  }
}


/* Main Footer */

.main-footer {
  font-size: 0.75em;
}

.main-footer > :last-child {
  margin-bottom: 0;
}

@media (max-width: 550px) and (min-width: 470px) {
  .main-footer {
    padding: 0 0.75rem 0.75rem;
  }
}


/* Controls */

.controls-wrap {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  transform: translateX(100%);
  background-color: inherit;
  transition: transform 400ms;
  box-shadow: inset 1px 0 0 rgba(0,0,0,0.15);
}

.controls-wrap.open {
  transform: translateX(0);
}

.controls-toggle {
  position: absolute;
  bottom: 1rem;
  right: calc(100% - 1px);
  padding: 0.5rem 0.25rem 0.5rem 0.5rem;
  color: inherit;
  background-color: inherit;
  border: none;
  border-radius: 0.5em 0 0 0.5em;
  box-shadow:
    inset 1px 0 0 rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(0,0,0,0.15),
    inset 0 -1px 0 rgba(0,0,0,0.15);
  cursor: pointer;
}

.controls-toggle svg {
  display: block;
  fill: currentColor;
}

.controls {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1.5rem;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
}

.controls fieldset:not(:last-child) {
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 -1px rgba(0,0,0,0.2);
}

.controls .title {
  display: block;
  padding: 0;
  font-size: x-small;
  text-transform: uppercase;
  letter-spacing: 0.125em;
}

.controls .subtitle {
  position: relative;
}

.controls .subtitle::after {
  --accessible-color: calc(
    (
      (
        (
          (var(--quaternary-red) * 299) +
          (var(--quaternary-green) * 587) +
          (var(--quaternary-blue) * 114)
        ) / 1000
      ) - 128
    ) * -1000
  );
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  display: block;
  width: 1.375em;
  height: 1.375em;
  box-shadow:
    inset 0 0 0 1px
    rgba(
      calc(var(--accessible-color)),
      calc(var(--accessible-color)),
      calc(var(--accessible-color)),
      0.2
    );
  border-radius: 0.25em;
}

.controls fieldset:nth-of-type(1) .subtitle::after {
  background-color:
    rgb(
      var(--primary-red),
      var(--primary-green),
      var(--primary-blue)
    );
}

.controls fieldset:nth-of-type(2) .subtitle::after {
  background-color:
    rgb(
      var(--secondary-red),
      var(--secondary-green),
      var(--secondary-blue)
    );
}

.controls fieldset:nth-of-type(3) .subtitle::after {
  background-color:
    rgb(
      var(--tertiary-red),
      var(--tertiary-green),
      var(--tertiary-blue)
    );
}

.controls fieldset:nth-of-type(4) .subtitle::after {
  background-color:
    rgb(
      var(--quaternary-red),
      var(--quaternary-green),
      var(--quaternary-blue)
    );
}

.controls label {
  display: block;
  padding: 0;
  font-size: x-small;
  text-transform: uppercase;
  letter-spacing: 0.125em;
}

.controls input[type="range"] {
  position: relative;
  width: 100%;
  margin-bottom: 0.5rem;
}

.controls input[type="range"]::before {
  content: attr(data-value);
  position: absolute;
  bottom: 100%;
  right: 0;
  padding: 0.25em 0.5em;
  color: #fff;
  background-color: rgba(0,0,0,0.6);
  border-radius: 0.25em;
}
              
            
!

JS

              
                var styles = getComputedStyle(document.body);
var root = document.documentElement;
var range = document.querySelectorAll('.range');
var controls = document.querySelector('.controls-wrap');
var controlsToggle = document.querySelector('.controls-toggle');

function setDataVal(element) {
  element.setAttribute('data-value', element.value);
}

for (var i = 0; i < range.length; i++) {
  var rangeItem = range[i];
  var initialRangeValue = parseInt(styles.getPropertyValue('--' + rangeItem.name));
  
  rangeItem.value = initialRangeValue;
  setDataVal(rangeItem);
  
  rangeItem.addEventListener('input', function() {
    root.style.setProperty('--' + this.name, this.value);
    setDataVal(this);
  });
}

controlsToggle.addEventListener('click', function() {
  controls.classList.toggle('open');
});

// Prevent search from submition for demo
var submit = document.querySelector('.submit');

submit.addEventListener('click', function(e) {
  e.preventDefault();
});
              
            
!
999px

Console