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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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="flex items-center justify-center vh-100">
  <div id="counter" class="flex flex-column">
  <button @click="decrementValue" class="button-reset bg-blue ba b--black ph4 pv3 mb2 white f4 dim">Decrement Counter Value</button>
  <button @click="incrementValue" class="button-reset bg-green ba b--black ph4 pv3 mb2 white f4 dim">Increments Counter Value</button>
  <button @click="resetValue" class="button-reset bg-red ba b--black ph4 pv3 mb2 white f4 dim">Reset Counter Value</button>
  <div class="f2 tc pa4 mv4 bg-light-gray ba b--light-silver">{{counter}}</div>
<!--   <div class="ph4 pv4 ba b--black-20">
    <input type="text" v-model="firstName" placeholder="First Name" class="input-reset ba b--black-10 ph4 pv3" />
  <button @click="logName" class="button-reset pv3 ph2 bg-white ba b--black-20">Log User Name</button>  
  </div> -->
</div>
</body>
              
            
!

CSS

              
                
              
            
!

JS

              
                
new Vue({
  el: '#counter',
  data: {
    counter: 0,
    firstName: ''
  },
  methods: {
    // incrementValue: function(){
    //   return this.counter == ++this.counter;
    // },
    // resetValue: function(){
    //   this.counter = 0;
    // },
    // decrementValue: function(){
    //   return this.counter == --this.counter;
    // },
    incrementValue() {
      this.counter++;
    },
    decrementValue() {
      this.counter--;
    },
    resetValue() {
      this.counter = 0;
    },
    logName: function(){
      console.log('firstName:', this.firstName);
    }
  }
})
              
            
!
999px

Console