css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div class="toggle-ctas">
  <button class="toggle-nav-cta add-inert">Toggle navigation with inert attribute</button>
  <button class="toggle-nav-cta">Toggle navigation</button>

<nav inert="">
    <li><a href="#">Item 1</a></li>
    <li><a href="#">Item 2</a></li>
    <li><a href="#">Item 3</a></li>
    <li><a href="#">Item 4</a></li>
    <li><a href="#">Item 5</a></li>
    <li><a href="#">Item 6</a></li>
    <li><a href="#">Item 7</a></li>
    <li><a href="#">Item 8</a></li>
    <li><a href="#">Item 9</a></li>
    <li><a href="#">Item 10</a></li>
  <h1>Title 1</h1>
  <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Reiciendis eaque aut delectus, molestias fugiat ad nihil veniam officiis neque, dolore quia amet <a href="#">some links to somewhere</a> minus rem sit non repellendus earum. Et, deserunt!</p>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Error porro aliquid architecto nisi tempora nihil rerum ipsam a temporibus, veritatis molestias, <a href="#">some links to somewhere</a> magnam at nam excepturi doloremque dolores sint quasi perferendis?</p>
  <h2>Title 2</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloribus modi ipsum eos <a href="#">some links to somewhere</a> inventore vitae corporis. Ea sunt illo odio amet aliquam recusandae harum optio delectus, distinctio quas cum quo. Ut.</p>
  <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Labore est <a href="#">some links to somewhere</a> magnam officia tenetur minima, veniam fugiat similique fugit. Adipisci, nobis? Molestias cupiditate, neque doloremque explicabo inventore odit nam? Beatae, tempore?</p>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Magni, ullam <a href="#">some links to somewhere</a> provident tempora quia doloremque adipisci? Minima voluptas, commodi <a href="#">some links to somewhere</a>  est sed alias id labore repudiandae nam cum ipsa ad maiores consequatur?</p>
              $white: hsl(0, 0, 100%);
$black: hsl(0, 0%, 20%);
$red: 	hsl(351, 83%, 25%);
$yellow: hsl(41, 85%, 52%);

body {
  background-color: $black;
  color: hsl(0, 0, 100%);

a {
  color: $yellow;

  background-color: $red;

button {
  background-color: $yellow;
  color: $black;
  cursor: pointer;
  padding: 0.5rem;
  border: 0;
  border-radius: 4px;
  font-weight: bold;

  position: fixed;
  top: 0;
  left: 0;
  padding: 0.5rem;
  z-index: 20;

nav, main {
  padding: 1rem;
  padding-top: 5rem;

main {
  max-width: 700px;
  margin: 0 auto;
  min-height: 100vh;

nav {
  background-color: $black;
  height: 100vh;
  width: 100vw;
  padding-bottom: 3rem;
  overflow-x: hidden;
  overflow-y: auto;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  transform: translate3d(-100%,0,0);
  transition: transform .4s ease-in-out;

  &.is-open {
    transform: translate3d(0,0,0);
              (function () {
  document.addEventListener("DOMContentLoaded", (event) => {
    const ctas = document.querySelectorAll(".toggle-nav-cta");

    Array.prototype.forEach.call(ctas, (el, i) => {
      const currentCta = ctas[i];

      currentCta.addEventListener("click", () => {

  const toggleNavigation = (currentElement) => {
    const navElement = document.querySelector("nav");
    const mainElemt = document.querySelector("main");

        navElement.inert = true;
        mainElemt.inert = false;
    } else {
        navElement.inert = false;
        mainElemt.inert = true;

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................