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

              
                .wrapper
  %header.site-header
    .nav-toggle
      %span
  .leader{:style => 'background-image:url(https://farm8.staticflickr.com/7595/16575563694_5259f740ed_k_d.jpg);'}
  .content 
    %p Swag cold-pressed Godard farm-to-table, American Apparel four dollar toast single-origin coffee. Cardigan butcher heirloom, messenger bag Banksy meh asymmetrical occupy lo-fi Etsy. Heirloom Thundercats fap twee Banksy, slow-carb XOXO Odd Future pour-over distillery typewriter Austin authentic meggings lumbersexual. Schlitz jean shorts Bushwick PBR, Helvetica Truffaut cred leggings selfies stumptown. Echo Park PBR keytar Marfa, cray hoodie hashtag farm-to-table. Swag wolf cray, kitsch mixtape typewriter VHS butcher irony. Tattooed fingerstache Helvetica, you probably haven't heard of them Blue Bottle lumbersexual selvage kitsch slow-carb disrupt bitters mustache yr vinyl cardigan.

    %p Beard literally XOXO ennui flexitarian, pork belly High Life deep v occupy typewriter. Beard wolf mumblecore Intelligentsia pug four dollar toast, wayfarers cliche lomo leggings chillwave small batch. Retro ethical fanny pack asymmetrical. 3 wolf moon cronut keffiyeh dreamcatcher Thundercats leggings. Flannel typewriter trust fund, Godard hoodie Williamsburg shabby chic scenester PBR&B. Tote bag deep v banh mi Portland flannel Godard. Squid Echo Park locavore pour-over, fixie lomo fap Portland.

    %p Truffaut readymade quinoa fanny pack Austin, Blue Bottle scenester fingerstache semiotics migas typewriter bitters viral. Cardigan selfies jean shorts mumblecore health goth, tofu chillwave pop-up cornhole stumptown letterpress bitters meditation scenester. Craft beer fingerstache beard art party chia. Dreamcatcher literally chia four loko, quinoa McSweeney's +1 authentic blog chillwave Kickstarter fingerstache American Apparel vinyl. Bitters hashtag paleo mixtape art party Carles Kickstarter, crucifix typewriter. Street art Bushwick meggings drinking vinegar food truck pour-over, McSweeney's shabby chic tilde leggings art party cornhole skateboard. Deep v Odd Future plaid mumblecore taxidermy, +1 butcher church-key slow-carb.

    
    %p Single-origin coffee meditation DIY literally, beard mustache Odd Future Echo Park ennui post-ironic flannel swag put a bird on it pug Kickstarter. Fashion axe post-ironic pour-over, biodiesel Helvetica tattooed blog Etsy drinking vinegar. Pickled keffiyeh four loko squid Williamsburg polaroid, gastropub flannel sustainable 3 wolf moon drinking vinegar aesthetic. Readymade chillwave ugh next level selfies meh. Retro Blue Bottle umami mlkshk, ennui Bushwick tofu actually next level tattooed. Banjo ennui fap fingerstache fanny pack High Life cornhole. Fingerstache quinoa kitsch food truck keffiyeh selfies.

%nav.main-nav
  %ul
    %li 
      %a{:href => '#'}Home
    %li 
      %a{:href => '#'} About
    %li 
      %a{:href => '#'} Work
    %li 
      %a{:href => '#'}Contact


              
            
!

CSS

              
                @import "compass/css3";

* {
  box-sizing: border-box;
}

a {
  text-decoration: none;
  color: #ec008c;
  
  &:hover {
    text-decoration: underline;
  }
}

body,
html {
  height: 100%;
}

$barwidth: 25px;
$ub-bgdarkblue: #fff;
$ub-textdarkblue: #fff;


.wrapper {
  height: 100%;
  transition: all .3s ease;
}
  .content {
    width: 650px;
    margin: 0 auto;
    
    p {
      line-height: 1.5;
      color: #666;
      margin: 1.5em 0;
    }
  }

  .leader {
    width: 100%;
    height: 66%;
    background-size: cover;
    background-position: center;
  }

.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  background-color: #fff;
  width: 100%;
  height: 100%;
  transform: translateY(-100%);
  transition: transform .3s ease;
  
  ul {
    width: 100%;
    list-style: none;
    line-height: 2;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    font-size: 24px;
  }
}

.site-header {
  width: 100%;
  height: 70px;
  background: #ec008c;
}


.is-active-menu {
  overflow: hidden;
  .main-nav {
    visibility: visible;
    transform: translateY(0);
  }
  
  .wrapper {
    position: relative;
    z-index: 20;
    transform: translateY(100%);
    margin-top: -70px;
  }
}

.nav-toggle {
  top: 25px;
  z-index: 2;
  right: 12px;
  width: $barwidth;
  height: 20px;
  padding: 8px 0;
  cursor: pointer;
  position: absolute;

  span {
    height: 4px;
    display: block;
    overflow: hidden;
    text-indent: 100%;
    background: $ub-textdarkblue;
    white-space: nowrap;
    width: $barwidth;
    transition: background 0.3s ease-in-out;
  }

  &::before, 
  &::after {
    left: 0;
    content: '';
    width: $barwidth;
    height: 4px;
    background: #fff;
    position: absolute;
    transform-origin: center center;
    transition: width 0.2s ease-in-out, background 0.2s ease-in-out, transform 0.2s ease-in-out, top 0.2s ease-in-out, bottom 0.2s ease-in-out, left 0.2s ease-in-out, right 0.2s ease-in-out;
  }

  &::before {
    top: 0;
  }

  &::after {
    bottom: 0;
  }

  &.menu-open {

    span {
      background: rgba(255,255,255,0);
    }

    &::before {
      top: 8px;
      transform: rotate(-45deg);
    }

    &::after {
      bottom: 8px;
      transform: rotate(45deg);
    }

    &::before, 
    &::after {
      width: 26px;
      background: #fff;
    }

    &:hover, 
    &:focus, 
    &:active {

      span {
        background: rgba(255,255,255,0);
      }

      &::before {
        top: 8px;
        left: -3px;
        transform: rotate(-45deg);
      }

      &::after {
        left: 9px;
        bottom: 8px;
        transform: rotate(45deg)
      }

      &::before, &::after {
        width: 18px;
      }
    }
  }

  &:hover,
  &:focus,
  &:active {

    span {
      background: rgba(255,255,255,0);
    }

    &::before {
      top: 8px;
      left: -3px;
      transform: rotate(45deg);
    }

    &::after {
      left: 9px;
      bottom: 8px;
      transform: rotate(-45deg)
    }

    &::before, &::after {
      width: 18px;
    }
  }
}
              
            
!

JS

              
                var menu = document.querySelector(".main-nav"),
    toggle = document.querySelector(".nav-toggle"),
    body = document.getElementsByTagName('body')[0];

function toggleToggle() {
  toggle.classList.toggle("menu-open");
};

function toggleMenu() {
  menu.classList.toggle("active");
  body.classList.toggle("is-active-menu");
};

toggle.addEventListener("click", toggleToggle, false);
toggle.addEventListener("click", toggleMenu, false);

document.onkeydown = check_key;

function check_key(e) {
    e = e || window.event;
    if(e.keyCode == '27') {      
      toggleToggle();
      toggleMenu();
    }
}

              
            
!
999px

Console