Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              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

            
          
!
            
              @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)
        

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console