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="p-4">
  <script id="tooltipTemplate" type="x/template">
     <transition :name="transition">
    <div v-show="show" class="absolute bg-teal-lightest border-t-4 border-teal radius text-teal-darkest px-4 py-2 shadow tooltip-box" role="alert">
      <div class="flex">
          <p class="text-sm">Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempora molestiae, numquam doloremque eos necessitatibus soluta placeat reiciendis, non provident similique in magnam omnis voluptates explicabo ad animi suscipit tenetur modi.</p>
      </div>
    </div>
    </transition>
  </script>
  <script id="tooltipButton" type="x/template">
     <div v-on:mouseover="showToolTip=true" v-on:mouseleave="showToolTip=false" class="inline-block relative">
       <button class="button primary bordered shadow radius cursor-help">
      <slot></slot>
    </button>
      <Tooltip :transition="transition" :show="showToolTip"></Tooltip>
    </div>   
  </script>
  <div id="app">
    <TooltipButton :transition="'fade'">Yes</TooltipButton>
  </div>
</body>
              
            
!

CSS

              
                .fade-enter-active {
  transition: opacity 0.5s;
}

.fade-leave-active {
  transition: opacity 0.7s;
}
.fade-enter, .fade-leave-to  {
  opacity: 0;
}

.cursor-help {
  cursor: help;
}

.tooltip-box {
  height: auto; 
  min-height: 200%; 
  top: 0%; 
  left: 115%; 
  min-width: 200px;
  @media screen and (min-width: 40em) {
    min-width: 400px;
  }
}

              
            
!

JS

              
                let Tooltip = Vue.component('tooltip',{
  template: "#tooltipTemplate",
  props: {
    show: {
      type: Boolean,
      required: true
    },
    transition: {
      type: String,
      default: 'fade',
      required: true 
    }
  }
})

let TooltipButton = Vue.component('tooltipbutton', {
  template: '#tooltipButton',
  props: {
    transition: {
      type: String,
      default: 'fade',
      required: false
    }
  },
  components: {
    Tooltip
  },
  data () {
    return {
      showToolTip: false
    }
  }
})

let App = new Vue({
  el: '#app',
  components: {
    TooltipButton
  }
})

              
            
!
999px

Console