Pen Settings



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


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


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.


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.


                - var sections = ['home', 'about', 'blog', 'contact']

  button.nav-icon#nav-icon: span
    each item in sections
      li: a(href='#' + item)=item
each section in sections
    p Click on the hamburger menu icon to see the vertical popout menu. Scroll down to see how it adapts to the background color. The menu icon is created using pure CSS, and the color of the menu adapts to the background color of the page by setting mix-blend-mode to "difference". The toggle animation only needs a tiny bit of JavaScript. This demo was tested in the latest versions of Chrome, Firefox and Safari. It also works on mobile.
    p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis nunc tellus, tempor vitae elit ac, ornare aliquet elit. Vivamus ac tincidunt est, vehicula semper neque. Aliquam eu velit mi. Mauris vel lorem sollicitudin, sollicitudin sem vel, pulvinar risus. Pellentesque ac pulvinar erat, quis aliquet lectus. Integer diam odio, auctor non ullamcorper scelerisque, imperdiet non est. Sed vulputate porttitor lorem, sit amet feugiat tortor pretium tristique. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultrices, lectus at ultricies tempus, massa lorem tincidunt urna, at porta nulla massa ac est. Aliquam commodo auctor tempus. In molestie nisl eget diam scelerisque, vel porta metus euismod. Praesent venenatis augue dignissim, vestibulum ex eget, vestibulum sem. In varius est leo. Nam id lobortis erat. Etiam et metus sit amet justo consectetur lacinia faucibus in elit. Aenean elit lorem, pellentesque sed pellentesque at, cursus eget felis.


                @import url(|Work+Sans:700)

$color-light: #fff
$color-dark: #111
$font-primary: 'Adobe Garamond Pro', 'EB Garamond', Garamond, Georgia, 'Times New Roman', serif
$font-secondary: 'Work Sans', 'Arial Black', Gadget, sans-serif

  box-sizing: border-box
  padding: 0
  margin: 0
  border: 0
  outline: 0
  -webkit-font-smoothing: antialiased

  font-size: 10px // rem reset

  background: $color-dark
  color: $color-light
  font: #{2.6rem}/1.55 $font-primary

  padding: 12.5%
  width: 100%

    background: $color-light
    color: $color-dark

  margin-bottom: 2.5em
  color: inherit
  text-decoration: none
  font: bold 2.8rem $font-secondary
  text-transform: uppercase
  letter-spacing: 5px
  margin-bottom: 2em
  mix-blend-mode: difference
  z-index: 100

    position: fixed
    top: 60px
    right: 5px
    height: 100vh
    visibility: hidden
    pointer-events: none
    list-style: none
    width: 35px

      font: bold 1.5rem $font-secondary
      text-transform: uppercase
      letter-spacing: 2px
      padding: 0.75em 0
      writing-mode: vertical-lr

  &.active ul
    visibility: visible
    pointer-events: initial
    transition-delay: 0.2s

// Inspired by:

  appearance: none
  background: transparent
  cursor: pointer
  display: inline-block
  height: 35px
  position: fixed
  top: 15px
  right: 15px
  transition: background 0.3s
  width: 35px

    position: absolute
    top: 15px
    left: 5px
    background: $color-light
    display: block
    height: 3px
    right: 5px
    transition: transform 0.3s

      width: 100%
      height: 3px
      background: $color-light
      content: ''
      display: block
      left: 0
      position: absolute

      top: -8px

      bottom: -8px

  .active & span
    transform: rotate(90deg)


                var nav = document.getElementById('nav');
var navlinks = nav.getElementsByTagName('a');

function toggleNav() {
    (nav.classList.contains('active')) ? nav.classList.remove('active') : nav.classList.add('active');

document.getElementById('nav-icon').addEventListener('click', function(e) {

for(var i = 0; i < navlinks.length; i++) {
    navlinks[i].addEventListener('click', function() {