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.

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.

HTML

            
              <link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">

<body class="sans-serif black pa4">
  <script id="dropdown" type="x/template">
    <div>
      <a href="#" v-on:click.prevent="showDropDown=!showDropDown" class="mr2 f6 link br1 bw1 ba ph3 pv1 dib black-40 flex items-center justify-center w4">
        <div>Catness</div>
  <img src="https://images.unsplash.com/photo-1511876849877-f8d0d953d2e0?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=a005647cf42ef9a8c66e1aed85ccc5ec&auto=format&fit=crop&w=3450&q=80" class="br-100 ba b--black-10 h2 w2 mh2" alt="avatar">
 <i :class="{ 'fa-caret-up': showDropDown, 'fa-caret-down': !showDropDown }" class="fa" aria-hidden="true"></i></a>
      <transition name="slide-fade">
        <div class="w4 mt1" v-if="showDropDown">
          <ul class="menu list pl0 pa0 ma0">
            <li v-for="link in links" class="list">
              <a href="#" class="dd-link pointer hover-bg-moon-gray">{{link.name}}</a>
            </li>
          </ul>
      </div>
      </transition>
    </div>
  </script>

  <div id="app">
    <Dropdown></Dropdown>
  </div>
</body>
            
          
!

CSS

            
              @import (less) "//cdnjs.cloudflare.com/ajax/libs/tachyons/4.9.1/tachyons.css";

.menu {
  .bg-near-white;
  .b--solid;
  .br--bottom;
  .bw1;
  .b--black-20;
  .white-80;
  .br2;
}

.menu li {
  .ba;
  .bl-0;
  .bt-0;
  .br-0;

  &:not(:last-child) {
    .b--solid;
    .b--black-30;
  }
}

.dd-link {
  .f6;
  .pa2;
  .link;
  .dim;
  .w-100;
  .h-100;
  .dib;
  .b--white-10;
  .black-80;
}

.slide-fade-enter-active {
  transition: all .3s ease;
}
.slide-fade-leave-active {
  transition: all .2s ease;
}
.slide-fade-enter { 
  transform: translateY(-50px);
  opacity: 0;
}
.slide-fade-leave-to {
 transform: translateY(-50px);
  opacity: 0; 
}



            
          
!

JS

            
              const DropDown = Vue.component("dropdown", {
  template: "#dropdown",
  data() {
    return {
      showDropDown: true,
      links: [
        {
          name: "Account"
        },
        {
          name: "Profile"
        },
        {
          name: "Logout"
        }
      ]
    };
  }
});

let App = new Vue({
  el: "#app",
  components: {
    DropDown
  }
});

            
          
!
999px

Console