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

              
                h2 click
.container.diag
  - for i in 1..3 do
    a.viewer.diag href="#"
      - for j in 1..21 do
        b

h2 check
.container.checker
  - for i in 1..3 do
    input name="check" id="check#{i}" type="checkbox" checked=(i != 2) /
    label for="check#{i}" class="viewer"
      - for j in 1..21 do
        b

h2 pick
.container.picker
  - for i in 1..3 do
    input name="pick" id="pick#{i}" type="radio" checked=(i == 2) /
    label for="pick#{i}" class="viewer"
      - for j in 1..21 do
        b

              
            
!

CSS

              
                @import compass

$num: 21
$size: 9px
$border: 3px
$box: 180px
$gutter: 9px
$vgut: $gutter

body
  margin: 0
  padding: 0
  background: #333
  color: #999
  font-family: sans-serif

h2
  clear: both
  text-align: center
  margin: 1em 0 0
  font-weight: normal
  font-size: $vgut * 1.5
  line-height: 0
  position: relative
  top: $vgut

input[type="checkbox"],
input[type="radio"]
  position: absolute
  top: -100%

.container
  margin: 0 auto $vgut
  width: $box * 3 + $gutter * 2 + $border * 6
  clear: both
    
.viewer
  +box-sizing(border-box)
  display: block
  float: left
  height: $box + $border * 2
  width: $box + $border * 2
  margin: 0 $gutter $vgut 0
  border: $border solid #222
  border-radius: 6px
  position: relative
  color: inherit
  background: rgba(127, 127, 127, 0.1)
  &:hover
    background: rgba(127, 127, 255, 0.1)
  &:active
    background: rgba(127, 255, 127, 0.1)
  &:last-child
    margin-right: 0

.viewer b
  position: absolute
  display: block
  height: $size
  width: $size
  margin: (-$size / 2) 0 0 (-$size / 2)
  border-radius: $size / 2
  background: #777
  transition: top 0.5s ease, left 0.5s ease

@-webkit-keyframes throb
  50%
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5)

@keyframes throb
  50%
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5)

@-webkit-keyframes dim
  50%
    opacity: 0.5

@keyframes dim
  50%
    opacity: 0.5

a,
label
  b
    top: $box
  @for $n from 0 to $num
    b:nth-child(#{$n + 1})
      left: $n * $box/ ($num - 1)

a:hover,
label:hover
  @for $n from 0 to $num
    b:nth-child(#{$n + 1})
      left: $n * ($box * 0.9) / ($num - 1)
      top: $box - ($n * $n * $box / ($num - 1) / ($num - 1)) *  0.667
      transition: top 0.5s ease ($num - $n) * 0.05s, left 0.5s ease ($num - $n) * 0.05s
      -webkit-animation: throb 1s ease $n * 0.1s infinite
      animation: throb 1s ease $n * 0.1s infinite

a:active,
input:checked + label
  @for $n from 0 to $num
    b:nth-child(#{$n + 1})
      top: $box / 2 + cos($n / $num * 3.14159 * 2) * $box / 4
      left: $box / 2 + sin($n / $num * 3.14159 * 2) * $box / 4
      -webkit-animation: dim 1s ease $n * 0.333333s infinite
      animation: dim 3s ease $n * 0.1s infinite

input:checked + label
  background: rgba(127, 255, 127, 0.1)
        
.checker
  background: rgba(127, 255, 127, 0.1)
        

              
            
!

JS

              
                
              
            
!
999px

Console