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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

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.

              <nav role="navigation" class="priority-nav">
    <li><a href="#">Home</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Clients</a></li>
    <li><a href="#">Contact Us</a></li>
    <li><a href="#">Buy Lemons</a></li>
    <li><a href="#">Dance Wildly</a></li>
    <li><a href="#">Go To Bed</a></li>
    <li><a href="#">Donate Millions</a></li>
    <li class="overflow-nav">
      <span class="overflow-nav-title">
      <ul class="overflow-nav-list"></ul>
              @import url(;

.priority-nav {
  background: #f06d06;
  height: 40px; // not ideal... do with JS?
  > ul {
    list-style: none;
    > li {
      display: inline-block;
      position: relative;
      &.overflow-nav {
        display: none;
  a {
    text-decoration: none;
    color: white;
    display: inline-block;
    padding: 10px 15px;
  &.resizing {
    overflow: hidden;

.overflow-nav-list {
  background: white;
  box-shadow: 0 0 10px rgba(black, 0.35);
  position: absolute;
  top: 95%; // moves to 100% on hover generally
  right: 0;
  opacity: 0;
  visibility: hidden;
  padding: 5px 0;
  width: 200px;
  color: #222;
  a {
    color: black;
    font-weight: bold;
    &:active {
      background: #f06d06;
      color: white;
  list-style: none;
  z-index: 1;
  right: -20px;
  &.show {
    opacity: 1;
    visibility: visible;
  > li > a,
  .primary > a {
    color: black;
    display: block;
  .primary-last {
    margin-right: 0;
.overflow-nav-title {
  cursor: pointer;
  text-align: center;
  background: white;
  color: #222;
  border-radius: 50%;
  font-size: 10px;
  width: 2em;
  height: 2em;
  line-height: 2.2em;
  vertical-align: top;
  display: inline-block;

.hide {
  display: none !important;
.show-inline-block {
  display: inline-block !important;

body {
  font-family: 'Source Sans Pro', sans-serif;
              var PriorityNav = {

  // used multiple times, so saving.
  menu: $(".priority-nav"),
  allNavElements: $(".priority-nav > ul > li:not('.overflow-nav')"),

  init: function() {

  setupMenu: function() {
    // Checking top position of first item (sometimes changes)
    var firstPos = $(".priority-nav > ul > li:first").position();
    // Empty collection in which to put menu items to move
    var wrappedElements = $();

    // Used to snag the previous menu item in addition to ones that have wrapped
    var first = true;

    // Loop through all the nav items...
    PriorityNav.allNavElements.each(function(i) {
      var el = $(this);

      // which to find wrapped elements
      var pos = el.position();
      if ( !== {

        // If element is wrapped, add it to set
        wrappedElements = wrappedElements.add(el);

        // Add the previous one too, if first
        if (first) {
          wrappedElements = wrappedElements.add(PriorityNav.allNavElements.eq(i-1));
          first = false;
    if (wrappedElements.length) {

      // Clone set before altering
      var newSet = wrappedElements.clone();

      // Hide ones that we're moving

      // Add wrapped elements to dropdown

      // Show new menu

      // Make overflow visible again so dropdown can be seen.
      $(".priority-nav").css("overflow", "visible");


  tearDown: function() {

  bindUIActions: function() {
    $(".overflow-nav-title").on("click", function() {

      .resize(function() {"resizing");
      .resize(_.debounce(function() {
      }, 500));



🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.