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

              
                 <link href='https://fonts.googleapis.com/css?family=Dosis:400,700' rel='stylesheet' type='text/css'>

<div class="page-wrap">
  <div class="inner-wrap">
    
    <header class="page-header">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/80625/orchard-04.svg" alt="Apple orchard logo" />
    </header>
    
    <nav class="select-menu">
      <section class="toggle left-toggle">
        <a data-menu-hook class="nav-option" href="#">Menu</a>
      </section> 
    </nav>
  
    <div class="content-wrap">
      <aside class="left-off-canvas">
        <ul>
          <a class="menu-option" href="#"><li>About</li></a>
          <a class="menu-option" href="#"><li>Hours</li></a>
          <a class="menu-option" href="#"><li>Location</li></a>
          <a class="menu-option" href="#"><li>Contact</li></a>
        </ul>
      </aside>

      <main class="main-content">
        <p>Aceymac apple adams's pearmain  apple adanac apple adirondack crab-apple. Airlie red, flesh apple akane  apple albany beauty apple albermarle pippin apple. Alderman apple allington pippin apple, american summer pearmain  apple arkansas black apple arthur turner apple.</p>
        <p>Baddow pippin apple bailey, sweet  apple ballarat seedling apple bardsey apple baumann's reinette apple. Beauty of hampshire apple, bedfordshire foundling apple belmont apple berner rosen apple. Bess pool apple beverly hills apple billie bound apple. Binet rouge apple black gilliflower apple blenheim orange apple blue pearmain  apple.</p>
        <p>Campfield apple cardinal von galen  apple carmeliter, reinette apple carolina red june apple. Charden apple charles ross apple chenango strawberry apple chinook apple. Chisel, jersey apple chivers delight apple christmas pearmain apple cinnamon spice apple claygate pearmain apple. Cockpit improved, apple connell, red apple cornish aromatic apple crofton scarlet  apple.</p>
      </main> 
    </div>
  </div>
</div>
              
            
!

CSS

              
                @import "compass/css3";

$header-color: #f9f2dd;
$menu-color: #f4e4ba;
$nav-text: #60432d;
$main-text: #333333;
$menu-text: #ed6e46;
$menu-width: 13rem;
$active-color: #719b6f;

html {
  font-size: 15px;
}

// Hide text when menu open
.page-wrap.menu-open {
  overflow-x: hidden;
  
  .content-wrap {
    margin-left: 0;
    transition: margin 700ms ease;
  }
}

.page-header {
  padding-top: .7rem;
  text-align: center;
  background: $header-color; 
}

.select-menu {
  padding: 0 2.6rem;
  background: $menu-color;
}

.nav-option {
  padding: .3rem 0;
  display: inline-block;
  font-family: 'Dosis', sans-serif;
  font-weight: bold;
  font-size: 1.4rem;
  color: $nav-text;
}

.nav-option.is-active {
  color: $active-color;
}

a {
  text-decoration: none;
}

.toggle {
  display: inline-block;
}

ul {
  margin: 0;
  padding: 0;
}

ul li {
  padding: .7rem 2.6rem;
  list-style-type: none;
  font-size: 1.1rem;
  color: $menu-text;
}

ul li:hover {
  background: $menu-color;
  color: darken($menu-color,55%);
}

.main-content {
  padding: 0 2.6rem;
  color: $main-text;
  font-size: 1.1rem;
  order: 2;
}

.content-wrap {
  margin-left: -$menu-width;
  display: flex;
  width: calc(100% + #{$menu-width});
}

.left-off-canvas {
  background: $header-color;
  flex: 0 0 $menu-width;
}

@media (min-width: 700px) { 
  html {
    font-size: 18px;
  }
  .left-off-canvas {
    height: calc(100vh);
  }
}
              
            
!

JS

              
                /*
Check out An Apple A Day project here:
https://jonitrythall.github.io/appleproject/ 
/*


/* Find hook, toggle class when clicked */
$('[data-menu-hook]').on('click', function(evt) {
  evt.preventDefault();
  
  $('.page-wrap').toggleClass('menu-open');
  
  $(this).toggleClass('is-active');
  
});
              
            
!
999px

Console