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.

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 class="container">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">Checkboxes</h3>
        </div>
        <div class="panel-body">
            <form role="form">

                <!-- CHECKBOXES -->
                <div class="form-group">
                    <label>Checkboxes</label>
                    <!-- Basic Checkbox -->
                    <div class="checkbox">
                        <label>
                            <input type="checkbox"> Active
                        </label>
                    </div>
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" disabled> Unchecked Disabled
                        </label>
                    </div>
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" checked="checked" disabled> Checked Disabled
                        </label>
                    </div>
                </div>

                <!-- ANIMATED CHECKBOXES -->
                <div class="form-group">
                    <label>Animated Checkboxes</label>
                    <!-- Animated Checkbox -->
                    <div class="checkbox-animated">
                        <input id="checkbox_animated_1" type="checkbox">
                        <label for="checkbox_animated_1">
                            <span class="check"></span>
                            <span class="box"></span>
                            Active
                        </label>
                    </div>
                    <div class="checkbox-animated">
                        <input id="checkbox_animated_2" type="checkbox" disabled>
                        <label for="checkbox_animated_2">
                            <span class="check"></span>
                            <span class="box"></span>
                            Unchecked Disabled
                        </label>
                    </div>
                    <div class="checkbox-animated">
                        <input id="checkbox_animated_3" type="checkbox" checked="checked" disabled>
                        <label for="checkbox_animated_3">
                            <span class="check"></span>
                            <span class="box"></span>
                            Checked Disabled
                        </label>
                    </div>
                </div>

                <!-- INLINE CHECKBOXES -->
                <div class="form-group">
                    <label>Inline Checkboxes</label>

                    <!-- Basic Checkbox -->
                    <div>
                        <label class="checkbox-inline">
                            <input type="checkbox"> Basic Checkbox
                        </label>
                        <label class="checkbox-inline">
                            <input type="checkbox"> Basic Checkbox
                        </label>
                    </div>


                    <!-- Animated Checkbox -->
                    <div>
                        <div class="checkbox-animated-inline">
                            <input id="checkbox_animated_4" type="checkbox">
                            <label for="checkbox_animated_4">
                                <span class="check"></span>
                                <span class="box"></span>
                                Animated Checkbox
                            </label>
                        </div>
                        <div class="checkbox-animated-inline">
                            <input id="checkbox_animated_5" type="checkbox">
                            <label for="checkbox_animated_5">
                                <span class="check"></span>
                                <span class="box"></span>
                                Animated Checkbox
                            </label>
                        </div>
                    </div>
                </div>

            </form>
          <p>
              A modified LESS version of <a href="https://scotch.io" target="_blank" target="_blank">scotch.io</a> tutorial: <a href=" https://scotch.io/tutorials/css/create-a-google-polymer-checkbox-using-css3" target="_blank">Create a Google Polymer Checkbox Using CSS3</a>.
            </p>
        </div>
    </div>
</div>
              
            
!

CSS

              
                //== Checkbox
//
//##

// Animated Checkbox
//
// Animated checkboxes will use a similar structure as the Bootstrap's default checkboxes.

.checkbox-animated {
  position: relative;
  margin-top: 10px;
  margin-bottom: 10px;

  input[type=checkbox] {
    display: none;
    
    &:disabled ~ label .box {
      border-color: #777;
      background-color: #E6E6E6;
    }

    &:disabled ~ label .check {
      border-color: #777;
    }

    &:checked ~ label .box {
      opacity: 0;
      -webkit-transform:  scale(0) rotate(-180deg);
      -moz-transform:     scale(0) rotate(-180deg);
      transform:          scale(0) rotate(-180deg);
    }

    &:checked ~ label .check {
      opacity:1;
      -webkit-transform:  scale(1) rotate(45deg);
      -moz-transform:     scale(1) rotate(45deg);
      transform:          scale(1) rotate(45deg);
    }
  }

  label {
    cursor: pointer;
    padding-left: 28px;
    font-weight: normal;
    margin-bottom: 0;

    & span {
      display: block;
      position: absolute;
      left: 0;
      -webkit-transition-duration:  0.3s;
      -moz-transition-duration:     0.3s;
      transition-duration:          0.3s;
    }

    & .box {
      border: 2px solid #000;
      height: 20px;
      width: 20px;
      z-index: 888;
      -webkit-transition-delay: 0.2s;
      -moz-transition-delay:    0.2s;
      transition-delay:         0.2s;
    }

    & .check {
      top: -7px;
      left: 6px;
      width: 12px;
      height: 24px;
      border: 2px solid #BADA55;
      border-top: none;
      border-left: none;
      opacity:0;
      z-index:888;
      -webkit-transform:  rotate(180deg);
      -moz-transform:     rotate(180deg);
      transform:          rotate(180deg);

      -webkit-transition-delay: 0.3s;
      -moz-transition-delay:    0.3s;
      transition-delay:         0.3s;
    }
  }
}

.checkbox-animated-inline {
  .checkbox-animated();

  &.checkbox-animated-inline {
    display: inline-block;
    & + .checkbox-animated-inline {
      margin-left: 10px;
    }
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console