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


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


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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.


              <ul class="site-nav" id="accessibleNav">
    <a href="#">Link 1</a>
    <a href="#">Link 2</a>
  <li class="site-nav--has-dropdown" aria-haspopup="true">
    <a href="#">Link 3 &#8595;</a>
    <ul class="site-nav--dropdown">
      <li><a href="#">Link 3a</a></li>
      <li><a href="#">Link 3b</a></li>
      <li><a href="#">Link 3c</a></li>
  <li class="site-nav--has-dropdown" aria-haspopup="true">
    <a href="#">Link 4 &#8595;</a>
    <ul class="site-nav--dropdown">
      <li><a href="#">Link 4a</a></li>
      <li><a href="#">Link 4b</a></li>
      <li><a href="#">Link 4c</a></li>
    <a href="#">Link 5</a>
    <a href="#">Link 6</a>

<div class="intro">
    Super accessible navigation
    <li>Keyboard friendly</li>
    <li>CSS transitions for drop downs</li>
    <li>Screen reader friendly</li>


              html, body {
  min-height: 100%;

body {
  padding: 100px 0;

.intro {
  padding: 20px 20px 100px;

.site-nav {
  display: block;
  margin: 0 auto;
  list-style: none;
  background: #333;
  text-align: center;
  font: {
    family: 'Open Sans', sans-serif;
    size: 16px;
    text-transform: uppercase;
    cursor: default;
  ul, li {
    padding: 0;
    margin: 0;

  li {
    position: relative;
    display: inline-block;

  a {
    display: block;
    text-decoration: none;
    color: #fff;
    padding: 10px;
    &:focus {
    	background-color: darken(#333, 5%);  
.site-nav--dropdown {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 5;
  background-color: #333;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0,-3px,0);
  transition: transform 400ms ease-out, opacity 150ms ease-out 100ms, visibility linear 200ms;
  a {
    text-transform: none;
    text-align: left;
    padding: 10px 50px 10px 10px;
    white-space: nowrap;

  .no-touch .site-nav--has-dropdown:hover &,
  .site-nav--has-dropdown.nav-hover &,
  .nav-focus + & {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0,0,0);
    transition: transform 120ms ease-in, opacity 0s ease-out, visibility linear;


              window.timber = window.timber || {};

$(function() {
  timber.cache = {
    // General
    $html: $('html'),
    $body: $('body'),

    // Navigation
    $navigation: $('#accessibleNav')

timber.accessibleNav = function () {
  var $nav = timber.cache.$navigation,
      $allLinks = $nav.find('a'),
      $topLevel = $nav.children('li').find('a'),
      $parents = $nav.find('.site-nav--has-dropdown'),
      $subMenuLinks = $nav.find('.site-nav--dropdown').find('a'),
      activeClass = 'nav-hover',
      focusClass = 'nav-focus';
  if ('ontouchstart' in window) {

  // Mouseenter
  $parents.on('mouseenter touchstart', function(evt) {
    var $el = $(this);

    if (!$el.hasClass(activeClass)) {


  $parents.on('mouseleave', function() {

  $subMenuLinks.on('touchstart', function(evt) {
    // Prevent touchstart on body from firing instead of link

  $allLinks.focus(function() {

  $allLinks.blur(function() {

  // accessibleNav private methods
  function handleFocus ($el) {
    var $subMenu = $'ul');
        hasSubMenu = $subMenu.hasClass('site-nav--dropdown') ? true : false,
        isSubItem = $('.site-nav--dropdown').has($el).length,
        $newFocus = null;

    // Add focus class for top level items, or keep menu shown
    if ( !isSubItem ) {
    } else {
      $newFocus = $el.closest('.site-nav--has-dropdown').find('a');

  function showDropdown ($el) {

    setTimeout(function() {
      timber.cache.$body.on('touchstart', function() {
    }, 250);

  function hideDropdown ($el) {

  function addFocus ($el) {

  function removeFocus ($el) {

// Initialize Timber's JS on docready
$(function() {