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

              
                <!-- No spacing due to whitespace bug in Chrome. -->
<div class="card">
  <label class="radio"><input id="radio1" type="radio" name="radios" checked><span class="outer"><span class="inner"></span></span>Robert Baratheon</label>
  <label class="radio"><input id="radio2" type="radio" name="radios"><span class="outer"><span class="inner"></span></span>Rhaegar Targaryen</label>
  <label class="radio"><input id="radio3" type="radio" name="radios"><span class="outer"><span class="inner"></span></span>Lyanna Stark</label>
  <label class="radio"><input id="radio4" type="radio" name="radios"><span class="outer"><span class="inner"></span></span>Tywin Lannister</label>
  <label class="radio"><input id="radio5" type="radio" name="radios"><span class="outer"><span class="inner"></span></span>Jon Arryn</label>
</div>
              
            
!

CSS

              
                @import "bourbon";

/* Variables
 ------------------------------------------------------------- */
$primary-color: rgb(12,112,180);
$secondary-color: rgb(240,139,59);
$medium-color: rgb(84,103,117);
$standard-font: normal 400 18px 'PT Sans', sans-serif;

/* Animation from Animate.css
 ------------------------------------------------------------- */
@include keyframes(cardEnter) {
  0%, 20%, 40%, 60%, 80%, 100% {
    transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }

  0% {
    opacity: 0;
    @include transform(scale3d(.3, .3, .3));
  }

  20% {
    @include transform(scale3d(1.1, 1.1, 1.1));
  }

  40% {
    @include transform(scale3d(.9, .9, .9));
  }

  60% {
    opacity: 1;
    @include transform(scale3d(1.03, 1.03, 1.03));
  }

  80% {
    @include transform(scale3d(.97, .97, .97));
  }

  100% {
    opacity: 1;
    @include transform(scale3d(1, 1, 1));
  }
}

/* Foundation
 ------------------------------------------------------------- */
body {
  background-color: $primary-color;
  color: $medium-color;
  font: $standard-font;
  -webkit-font-smoothing: antialiased;
}

/* Container
 ------------------------------------------------------------- */
.card {
  @include animation(cardEnter .75s ease-in-out .5s);
  animation-fill-mode: both;
  max-width: 250px;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.4);
  margin: 20px auto;
  opacity: 0;
}

/* Individual Controls
 ------------------------------------------------------------- */
.radio {
  display: inline-block;
  padding-right: 20px;
  font-size: 18px;
  line-height: 49px;
  cursor: pointer;
  &:hover .inner {
    @include transform(scale(.5));
    opacity: .5;
  }
  
  // Native input control and checked events
  input {
    @include size(1px);
    opacity: 0; // Hide input, but leave it available for tabbing
    &:checked + .outer .inner {
      @include transform(scale(1));
      opacity: 1;
    }
    &:checked + .outer { border: 3px solid $secondary-color; }
    &:focus + .outer .inner {
      @include transform(scale(1));
      opacity: 1;
      background-color: darken($secondary-color, 10);
    }
  }
  
  // Outer ring of custom radio
  .outer {
    @include size(20px);
    display: block;
    float: left;
    margin: 10px 9px 10px 10px;
    border: 3px solid $primary-color;
    border-radius: 50%;
    background-color: #fff;
  }
  
  // Inner ring of custom radio
  .inner {
    @include transition(all .25s ease-in-out);
    @include size(16px);
    @include transform(scale(0));
    display: block;
    margin: 2px;
    border-radius: 50%;
    background-color: $secondary-color;
    opacity: 0;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console