Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <label for="menu-opener" tabindex="0" aria-haspopup="true" role="button"	aria-controls="menu" class="OpenMenuButton" id="openmenu">OPEN MENU</label>


<input type="checkbox" data-menu id="menu-opener" hidden>
<aside class="DrawerMenu" role="menu" id="menu" aria-labelledby="openmenu">
  <nav class="Menu">
    <h2>Awesome CSS Menu</h2>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 01</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 02</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 03</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 04</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 05</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 06</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 07</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 08</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 09</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 10</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 11</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 12</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 13</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 14</a>
    <a role="menuitem" tabindex="-1" href="#">Menu Item 15</a>
  </nav>
  <label for="menu-opener" class="MenuOverlay"></label>
</aside>
              
            
!

CSS

              
                @custom-selector :--opened-menu [data-menu]:checked;
@custom-media --from-small (min-width: 30em);

.OpenMenuButton {
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 900;
  word-spacing: 140%;
  letter-spacing: 4px;
}


.DrawerMenu {
  position: fixed;
  z-index: 99;
  width: 100vw;
  height: 100vh;
  top: 0;
  bottom: 0;
  transform: translateX(-100%);
  transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
  display: grid;
  grid-template-areas: 'MENU OVERLAY';
  grid-template-columns: 15fr 5fr;
  
  @media (--from-small) {
    grid-template-columns: auto 1fr;
  }
  
  @nest :--opened-menu ~ & {
    transform: none;
  }
  
}


.Menu {
  display: block;
  flex-flow: column wrap;
  transform: translateX(-30%);
  opacity: 0;
  color: #fff;
  transition: all 500ms cubic-bezier(0.4, 0.0, 0.2, 1);
  transition-delay: 0;
  contain: content;
  grid-area: 'MENU';
  background-color: rebeccapurple;
  box-sizing: border-box;
  padding: 24px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  
  @media (--from-small) {
    min-width: 400px;
  }
  
  
  @nest :--opened-menu ~ .DrawerMenu & {
    transform: none;
    opacity: 1;
    transition-delay: 300ms;
  }
  
  & a {
    text-decoration: none;
    color: #FFFFFF80;
    display: block;
    padding: 16px 0;
    
    &:hover {
      color: #69F0AE;
    }
  }
  
  & > * + * {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
}


.MenuOverlay {
  display: block;
  grid-area: 'OVERLAY'; 
  
  @nest [data-menu]:not(:checked) ~ .DrawerMenu & {
    pointer-events: none;
  }
}























































































































































@use postcss-preset-env {
  stage: 0;
  browsers: [
    "last 1 Chrome versions",
    "last 1 Firefox versions",
    "last 1 Safari versions",
    "last 1 Edge versions"
  ]
}

              
            
!

JS

              
                
              
            
!
999px

Console