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

              
                <div id="app">
  <checkbox name="subscribe" value="css" label="CSS" v-model="css" id="checkbox1"></checkbox>
  <checkbox name="subscribe" id="checkbox2" className="another-class" value="2" label="HTML" v-bind:inverted="false" v-model="html" v-bind:checked="html" v-bind:required="true"></checkbox>
  <checkbox name="subscribe" value="3" label="JavaScript" v-on:input="javascript" id="checkbox3"></checkbox>
</div>
              
            
!

CSS

              
                body{
  margin: 20px auto;
  padding: 1% 2%;
  color: #2c3e50;
  font-size: 17px;
  max-width: 80vw;
  background: #ecf0f1;
  font-family: 'Karla', sans-serif;
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}
// all boxes and radios have these parent wrappers
.custom-checkbox {
  // easy inline labels
  display: flex;
  padding: 5px;
  margin: 5px auto;
  
  input[type=checkbox], input[type=radio], label {
    // dont highlight text when double clicking
    user-select: none;
  }
  input[type=checkbox], input[type=radio] {
    position: relative;
    border: 1px solid blue;
    margin: 0 0.2em 0 0;
    padding: 0;
    text-align: center;
    width: 1.3rem;
    height: 1.3rem;
    background: white;
    -webkit-appearance: none;
    -webkit-border-radius: 0;
    border-radius: 0;
    color: rgba(white, 0);
    transition: all 0.2s ease;
    // Better Font Rendering
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    &:before {
      // checkmark
      content: "✔";
    }
    &:focus {
      outline: 0;
      border: 1px solid darken(blue, 5%);
    }
    &:active {
      outline: none;
    }
    &:hover {
      outline: none;
    }
    &:checked {
      background: blue;
      // the color is what hides the checkmark
      color: rgba(white, 1);
    }
  }
  // an `inverted` class is there for making simple alternative styles
  &.inverted {
    input[type=checkbox], input[type=radio] {
      border: 1px solid black;
      &:focus {
        border: 1px solid darken(black, 5%);
      }
      &:checked {
        background: black;
      }
    }
  }
}
              
            
!

JS

              
                // https://github.com/invokemedia/vue-radio-checkbox
Vue.component('checkbox',{
  template: `
    <div class="custom-checkbox" v-bind:class="{ inverted: inverted }">
      <input type="checkbox" v-bind:name="name" v-bind:class="className" v-bind:id="id" v-bind:value="value" v-bind:checked="checked" v-bind:required="required" v-on:change="updateInput">
      <label v-bind:for="id">{{ label }}</label>
    </div>
  `,
  props: {
    name: {
      type: String,
      required: false
    },
    className: {
      type: String,
      required: false
    },
    id: {
      type: String,
      required: false
    },
    value: {
      type: String,
      required: false
    },
    required: {
      type: Boolean,
      required: false,
      default: false
    },
    checked: {
      type: Boolean,
      required: false,
      default: false
    },
    label: {
      type: String,
      required: true
    },
    inverted: {
      type: Boolean,
      required: false,
      default: false
    }
  },
  methods: {
    updateInput: function(event) {
      this.$emit('input', event.target.checked);
    }
  }
})

let app = new Vue({
  el: '#app',
  data () {
    return {
      css: '',
      html: '',
      javascript: ''
    }
  }
})
              
            
!
999px

Console