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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <header role="banner">
  <nav class="nav" role="navigation">
    <ul class="nav__list">
      <li>
        <input id="group-1" type="checkbox" hidden />
        <label for="group-1"><span class="fa fa-angle-right"></span> First level</label>
        <ul class="group-list">
          <li><a href="#">1st level item</a></li>
          <li>
            <input id="sub-group-1" type="checkbox" hidden />
            <label for="sub-group-1"><span class="fa fa-angle-right"></span> Second level</label>
            <ul class="sub-group-list">
              <li><a href="#">2nd level nav item</a></li>
              <li><a href="#">2nd level nav item</a></li>
              <li><a href="#">2nd level nav item</a></li>
              <li>
                <input id="sub-sub-group-1" type="checkbox" hidden />
                <label for="sub-sub-group-1"><span class="fa fa-angle-right"></span> Third level</label>
                <ul class="sub-sub-group-list">
                  <li><a href="#">3rd level nav item</a></li>
                  <li><a href="#">3rd level nav item</a></li>
                  <li><a href="#">3rd level nav item</a></li>
                </ul>
              </li>
            </ul>
          </li>
        </ul>
      </li>
      <li>
        <input id="group-2" type="checkbox" hidden />
        <label for="group-2"><span class="fa fa-angle-right"></span> First level</label>
        <ul class="group-list">
          <li>
            <li><a href="#">1st level item</a></li>
            <li><a href="#">1st level item</a></li>
            <input id="sub-group-2" type="checkbox" hidden />
            <label for="sub-group-2"><span class="fa fa-angle-right"></span> Second level</label>
            <ul class="sub-group-list">
              <li><a href="#">2nd level nav item</a></li>
              <li><a href="#">2nd level nav item</a></li>
              <li>
                <input id="sub-sub-group-2" type="checkbox" hidden />
                <label for="sub-sub-group-2"><span class="fa fa-angle-right"></span> Third level</label>
                <ul class="sub-sub-group-list">
                  <li><a href="#">3rd level nav item</a></li>
                </ul>
              </li>
            </ul>
          </li>
        </ul>
      </li>
      <li>
        <input id="group-3" type="checkbox" hidden />
        <label for="group-3"><span class="fa fa-angle-right"></span> First level</label>
        <ul class="group-list">
          <li>
            <li><a href="#">1st level item</a></li>
            <li><a href="#">1st level item</a></li>
            <input id="sub-group-3" type="checkbox" hidden />
            <label for="sub-group-3"><span class="fa fa-angle-right"></span> Second level</label>
            <ul class="sub-group-list">
              <li><a href="#">2nd level nav item</a></li>
              <li><a href="#">2nd level nav item</a></li>
              <li><a href="#">2nd level nav item</a></li>
              <li>
                <input id="sub-sub-group-3" type="checkbox" hidden />
                <label for="sub-sub-group-3"><span class="fa fa-angle-right"></span> Third level</label>
                <ul class="sub-sub-group-list">
                  <li><a href="#">3rd level nav item</a></li>
                  <li><a href="#">3rd level nav item</a></li>
                  <li><a href="#">3rd level nav item</a></li>
                </ul>
              </li>
            </ul>
          </li>
        </ul>
      </li>
      <li>
        <input id="group-4" type="checkbox" hidden />
        <label for="group-4"><span class="fa fa-angle-right"></span> First level</label>
        <ul class="group-list">
          <li>
            <li><a href="#">1st level item</a></li>
            <input id="sub-group-4" type="checkbox" hidden />
            <label for="sub-group-4"><span class="fa fa-angle-right"></span> Second level</label>
            <ul class="sub-group-list">
              <li><a href="#">2nd level nav item</a></li>
              <li><a href="#">2nd level nav item</a></li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </nav>
  <footer>
    <ul class="soc-media">
      <li><a href="https://twitter.com/alexdevero" target="_blank"><span class="fa fa-twitter"></span></a></li>
      <li><a href="https://www.facebook.com/deveroalex" target="_blank"><span class="fa fa-facebook"></span></a></li>
      <li><a href="https://plus.google.com/+AlexDevero" target="_blank"><span class="fa fa-google-plus"></span></a></li>
      <li><a href="http://blog.alexdevero.com" target="_blank"><span class="fa fa-globe"></span></a></li>
    </ul>
  </footer>
</header>
              
            
!

CSS

              
                // Remy function
@function remy($value) {
  @return ($value / 16px) * 1rem;
}
body {
  margin-top: 2rem;
  font: 100% "Open sans", "Trebuchet MS", sans-serif;
}
a {text-decoration: none;}
/**
 * Hidden fallback
 */
[hidden] {
  display: none;
  visibility: hidden;
}
/**
 * Styling navigation
 */
header {
  margin-right: auto;
  margin-left: auto;
  max-width: remy(360px);
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
}
/**
 * Styling top level items
 */
.nav a,
.nav label {
  display: block;
  padding: .85rem;
  color: #fff;
  background-color: #151515;
  box-shadow: inset 0 -1px lighten(#151515, 3%);
  transition: all .25s ease-in;
  &:focus,
  &:hover {
    color: rgba(255,255,255,.5);
    background: darken(#151515, 7%);
  }
}
.nav label {cursor: pointer;}
/**
 * Styling first level lists items
 */
.group-list a,
.group-list label {
  padding-left: 2rem;
  background: #252525;
  box-shadow: inset 0 -1px lighten(#252525, 7%);
  &:focus,
  &:hover {background: darken(#252525, 7%);}
}
/**
 * Styling second level list items
 */
.sub-group-list a,
.sub-group-list label {
  padding-left: 4rem;
  background: #353535;
  box-shadow: inset 0 -1px lighten(#353535, 7%);
  &:focus,
  &:hover {background: darken(#353535, 7%);}
}
/**
 * Styling third level list items
 */
.sub-sub-group-list a,
.sub-sub-group-list label {
  padding-left: 6rem;
  background: #454545;
  box-shadow: inset 0 -1px lighten(#454545, 7%);
  &:focus,
  &:hover {background: darken(#454545, 7%);}
}
/**
 * Hide nested lists
 */
.group-list,
.sub-group-list,
.sub-sub-group-list {
  height: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height .5s ease-in-out;
}
 
.nav__list input[type=checkbox]:checked + label + ul {
	/* reset the height when checkbox is checked */
  max-height: 1000px;
}
/**
 * Rotating chevron icon
 */
label > span {
  float: right;
  transition: transform .65s ease;
}
.nav__list input[type=checkbox]:checked + label > span {transform: rotate(90deg);}
/**
 * Styling footer
 */
footer {
  padding-top: 1rem;
  padding-bottom: 1rem;
  background-color: #050505;
}
.soc-media {
  display: flex;
  justify-content: center;
}
.soc-media li:nth-child(n+2) {margin-left: 1rem;}
.soc-media a {
  font-size: 1.25rem;
  color: rgba(255,255,255,.65);
  transition: color .25s ease-in;
  &:focus,
  &:hover {color: rgba(255,255,255,.2);}
}
              
            
!

JS

              
                
              
            
!
999px

Console