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.

            
              <nav>
  <input type="checkbox" id="nav" class="hidden"/>
  <label for="nav" class="nav-open"><i></i><i></i><i></i></label>
  <div class="nav-container">
    <ul>
      <li><a href="#">Work</a></li>
      <li><a href="#">About</a></li>
      <li><a href="#">Careers</a></li>
      <li><a href="#">Contact</a></li>
    </ul>
  </div>
</nav>
            
          
!
            
              $color = #1F2227

body
  font-family 'Helvetica Neue', sans-serif
  font-weight 400

*
  box-sizing border-box

nav
  padding 30px
  ul
    float right
    li
      display inline-block
      float left
      &:not(:first-child)
        margin-left 25px
      a
        display inline-block
        outline none
        color $color
        font-size 16px
        text-decoration none
        letter-spacing .04em
        &:hover
          color gray
          text-decoration none
        
@media screen and (max-width: 560px) 
	.nav-container 
    position fixed
    top 0
    left 0
    height 100%
    width 100%
    z-index -1
    background $color
    opacity 0
    transition all .2s ease
    ul
      position absolute
      top 50%
      transform translateY(-50%)
      width 100%
      li
        display block
        float none
        width 100%
        text-align right
        margin-bottom 10px
        &:nth-child(1) a
          transition-delay .2s
        &:nth-child(2) a
          transition-delay .3s
        &:nth-child(3) a
          transition-delay .4s
        &:nth-child(4) a
          transition-delay .5s
        &:not(:first-child)
          margin-left 0
        a
          padding 10px 25px
          opacity 0
          color white
          font-size 24px
          font-weight 600
          transform translateY(-20px)
          transition all .2s ease
          
          
   .nav-open
      position fixed
      right 10px
      top 10px
      display block
      width 48px
      height 48px
      cursor pointer
      z-index 9999
      border-radius 50%
      i
        display block
        width 20px
        height 2px
        background $color
        border-radius 2px  
        margin-left 14px
      i:nth-child(1)
        margin-top 16px
      i:nth-child(2)
        margin-top 4px
        opacity 1
      i:nth-child(3)
        margin-top 4px
        

  
#nav:checked + .nav-open
  transform rotate(45deg)
  i
    background white
    transition transform .2s ease
    &:nth-child(1)
      transform translateY(6px) rotate(180deg)
    &:nth-child(2)
      opacity 0
    &:nth-child(3)
      transform translateY(-6px) rotate(90deg)

#nav:checked ~ .nav-container
  z-index 9990
  opacity 1
  ul li
    a
      opacity 1
      transform translateY(0)
    
.hidden
  display none
            
          
!
999px
🕑 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.

Console