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

              
                <body class="helvetica">
  
  <header class="dropbar">
    
    <nav class="nav-bar theme-dark">
      <h1 class="left h3"><a href="#" class="h3 block px1">Dropbar</a></h1>
      <a href="#menu" class="left px1">Menu</a>
      <div class="right">
        <!--<a href="#me" class="px1">Me</a>-->
        <div class="dropdown dropdown-right theme-dark">
          <a href="#" class="dropdown-toggle">Me</a>
          <ul class="dropdown-menu menu theme-dark rounded-bottom">
            <li><a href="#">Profile</a></li>
            <li><a href="#">My Stuff</a></li>
            <li><a href="#">Settings</a></li>
            <li><a href="#">Sign Out</a></li>
          </ul>
        </div>
      </div>
    </nav>
    
    <div id="menu" class="dropbar-drawer theme-dark open-close">
      <div class="px1">
        <div class="container">
          
          <div class="grid-12 py1">
            <input type="text" placeholder="Search"  class="input search grid-6" />
          </div>
          
          <div class="grid-4">
            <h2 class="p light-gray mb1">Featured</h2>
            <ul class="ul menu mb1 p">
              <li><a href="#">New</a></li>
              <li><a href="#">Popular</a></li>
              <li><a href="#">Nearby</a></li>
              <li><a href="#">Specials</a></li>
            </ul>
          </div>
          
          <div class="grid-4">
            <h2 class="p light-gray mb1">Categories</h2>
            <ul class="ul menu">
              <li><a href="#">Dropbars</a></li>
              <li><a href="#">Cranksets</a></li>
              <li><a href="#">Cogs</a></li>
              <li><a href="#">Chains</a></li>
              <li><a href="#">Wheels</a></li>
              <li><a href="#">More categories...</a></li>
            </ul>
          </div>
          
          <div class="grid-4">
            <h2 class="p light-gray mb1">Tags</h2>
            <ul class="grid-6 ul menu mb1">
              <li><a href="#">#Fixed</a></li>
              <li><a href="#">#Road</a></li>
              <li><a href="#">#BMX</a></li>
              <li><a href="#">#Touring</a></li>
              <li><a href="#">#Commuter</a></li>
              <li><a href="#">More tags...</a></li>
            </ul>   
          </div>
         
          <div class="grid-12">
            <ul class="ul ul-inline tappable menu small">
              <li><a href="#" class="link-dark">Help</a></li>
              <li><a href="#" class="link-dark">Contact</a></li>
              <li><a href="#" class="link-dark">Terms of Use</a></li>
              <li><a href="#" class="link-dark">Privacy Policy</a></li>
              <li class="link-dark">Made with love by Jxnblk</li>
            </ul>
          </div>
          
        </div>
      </div>
    </div><!-- .dropbar-drawer -->
    
    <!--<div id="me" class="dropbar-menu theme-dark">
      <ul class="ul menu tappable">
        <li><a href="#">Profile</a></li>
        <li><a href="#">My Stuff</a></li>
        <li><a href="#">Settings</a></li>
        <li><a href="#" class="">Sign Out</a></li>
      </ul>
    </div>-->

  </header>

  <main class="wrap px1 py2">
    
    <h1 class="massive">Dropbar</h1>
    <p>A responsive, responsive disclosure based navigation pattern that is hopefully way better than Hamburgers and Basements</p>
    
    <div class="py2 tiles">
      <div class="container">
        <div class="grid-12 mb1">
          <h2 class="inline-block mr1">New</h2>
          <a href="#">View all</a>
        </div>
        <div class="grid-4 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-4 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-4 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-4 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-4 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-4 mb1">
          <img src="//placehold.it/256" />
        </div>
      </div>
    </div>
    
    <div class="py2 tiles">
      <div class="container">
        <div class="grid-12 mb1">
          <h2 class="inline-block mr1">Popular</h2>
          <a href="#">View all</a>
        </div>
        <div class="grid-4 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-4 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-4 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-4 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-4 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-4 mb1">
          <img src="//placehold.it/256" />
        </div>
      </div>
    </div>
    
    <div class="py2 tiles">
      <div class="container">
        <div class="grid-12 mb1">
          <h2 class="inline-block mr1">Nearby</h2>
          <a href="#">View all</a>
        </div>
        <div class="grid-3 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-3 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-3 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-3 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-3 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-3 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-3 mb1">
          <img src="//placehold.it/256" />
        </div>
        <div class="grid-3 mb1">
          <img src="//placehold.it/256" />
        </div>
      </div>
    </div>
    
    <!--<div class="py2 tiles">
      <div class="container">
        <h2 class="mb1">Categories</h2>
        <ul class="grid-4 ul mb1 h3 bold">
          <li><a href="#">Dropbars</a></li>
          <li><a href="#">Cranksets</a></li>
          <li><a href="#">Cogs</a></li>
          <li><a href="#">Chains</a></li>
          <li><a href="#">Wheels</a></li>
          <li><a href="#">More categories...</a></li>
        </ul>
      </div>
    </div>-->
    
    
  </main>
  
  <footer class="footer">
    <div class="wrap px1">
      <ul class="ul ul-inline small bold tappable">
        <li><a href="#menu" class="light-gray">Menu</a></li>
        <li><a href="#" class="light-gray">Top</a></li>
      </ul>
    </div>
  </footer>
  
</body>
              
            
!

CSS

              
                $blue: #0cf;
$gray: #444;
$light-gray: #999;

.nav-bar {
  position: absolute;
  top: 0; right: 0; left: 0;
  z-index: 1;
  min-height: 3rem;
  line-height: 3rem;
}
.tappable { line-height: 3rem; }
.menu a {
  display: block;
  font-weight: bold;
}
.dropbar {
  position: relative;
  min-height: 3rem;
}
.dropbar-drawer {
  padding-top: 3rem;
  position: relative;
  max-height: 0;
  overflow: hidden;
  transition: top, padding-top, max-height .3s linear;
  &.is-open,
  &:target {
    max-height: 1024px;
  }
}
.dropbar-menu {
  max-height: 0;
  overflow: hidden;
  padding-right: 2rem; padding-left: 2rem;
  position: absolute;
  right: 0;
  margin-right: 1rem;
  transition: max-height .3s ease;
  &.is-open,
  &:hover {
    top: 0;
    padding-top: 3rem;
    max-height: 256px;
  }
  border-radius: 0 0 .25rem .25rem;
}

.dropdown {
  position: relative;
  a {
    display: block;
    whitespace: no-wrap;
    padding-right: 1rem; padding-left: 1rem;
  }
  .dropdown-toggle{
    position: relative;
    z-index: 1;
  }
  .dropdown-menu {
    position: absolute;
    top: 0;
    list-style: none;
    padding-top: 3rem; padding-left: 0;
    min-width: 8rem;
    max-height: 0;
    overflow: hidden;
    //display: none;
  }
  &:hover {
    .dropdown-menu {
      max-height: 512px;
      //display: block;
    }
  }
  &.dropdown-right {
    float: right;
    .dropdown-menu {
      right: 0;
    }
  }
}

.wrap {
  max-width: 960px;
  margin-right: auto; margin-left: auto;
}

@mixin break($breakpoint){
  @media (min-width: $breakpoint) { @content }
}

@mixin build-grid {
  $columns: 12;
  $gutter: 2.5%;
  $breakpoint: 512px;
  $column-width: (100% / $columns) - $gutter;
    // Add multiple breakpoints paired with $columns:
    // $breakpoints: (1 640px, 6 768px, 12 1024px);
    // ... or handle one in-between breakpoint?

  $grid-classes: ();
  @for $i from 1 through $columns {
    $grid-classes: $grid-classes, unquote('.grid-#{$i}');
  }
  .container {
    overflow: hidden;
  }
  #{$grid-classes} {
    float: left;
    width: 100%;
    & > &:last-child {
      margin-right: 0;
    }
  }
  @for $i from 1 through $columns {
    @include break($breakpoint){
      .container {
        margin-right: -$gutter;
        margin-left: -$gutter;
        padding-left: $gutter;
      }
      .grid-#{$i} {
        width: ($column-width * $i) + ($gutter * ($i - 1));
        margin-right: $gutter;
      }
      .push-#{$i} { margin-left: ($column-width * $i) + ($gutter * ($i)); }
      .pull-#{$i} { margin-right: ($column-width * $i) + ($gutter * ($i)); }
    }
  }
}
@include build-grid;

.clearfix { overflow: hidden; }
.left { float: left; }
.right { float: right; }

.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.hide { display: none; }

.p1 { padding: 1rem; }
.px1 { padding-right: 1rem; padding-left: 1rem; }
.py1 { padding-top: 1rem; padding-bottom: 1rem; }
.py2 { padding-top: 2rem; padding-bottom: 2rem; }

.mr1 { margin-right: 1rem; }
.mb1 { margin-bottom: 1rem; }

.ul {
  list-style: none;
  padding-left: 0;
  li {
    margin-bottom: .5em;
  }
}
.ul-inline li {
  display: inline-block;
  margin-right: 1rem;
  margin-bottom: 0;
}

.input {
  box-sizing: border-box;
  padding: .25rem .75rem;
  height: 2rem;
  line-height: 2rem;
  
  // Theme
  border-radius: .25rem;
  border: 1px solid #aaa;
  &:focus {
    outline: none;
    border: 1px solid $blue;
    box-shadow: 0 0 .5rem rgba($blue,.8);
  }
}

img { max-width: 100%; }
.tiles img { width: 100%; }

// For demonstration only
@keyframes open-close {
  0% { max-height: 0; }
  50% { max-height: 1024px; }
  100% { max-height: 0; }
}
.open-close { animation: open-close 1.5s ease-in-out; }



// Base styles & utilities
body,h1,h2,h3,h4,h5,h6,ul,ol,p { margin: 0; }
.massive {
  font-size: 4rem;
  @include break(640px){
    font-size: 6rem;
  }
}
h1, .h1 { font-size: 3rem; }
h2, .h2 { font-size: 2rem; }
h3, h4, h5, h6, p, .p, .h3 { font-size: 1.25rem; }
.small { font-size: .75rem; }

.helvetica { font-family: 'Helvetica Neue', Helvetica, sans-serif; line-height: 1.375; color: $gray; }

.regular { font-weight: normal; }
.bold { font-weight: bold; }


a {
  color: $blue; text-decoration: none;
  &:hover {
    color: darken($blue,10%);
  }
}
.blue { color: $blue; }
.gray { color: $gray; }
.light-gray { color: $light-gray; }

.outline, .outline * { outline: 1px solid rgba($blue,.5); }
.rounded-bottom {
  border-radius: 0 0 .25rem .25rem;
}
.theme-dark {
  color: #fff; background-color: #1c2226;
  .menu a:hover {
    background-color: rgba(#000,.5);
  }
}
.link-dark { color: darken($blue,20%); }
.blue { color: $blue; }

              
            
!

JS

              
                
              
            
!
999px

Console