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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                .switch
  input(type='checkbox' id='switch')
  label(for='switch')
              
            
!

CSS

              
                $switch-color: #9c6
$switch-size: 60px

.switch
  position: relative
  width: $switch-size
  height: $switch-size*.44
  input
    visibility: hidden
    &:checked + label
      background-color: $switch-color
      &:hover
        background-color: darken($switch-color, 10%)
      &:after
        left: $switch-size*.53
  label
    position: absolute
    left: 0
    top: 0
    width: $switch-size
    height: $switch-size*0.44
    background-color: rgba(0,0,0,.12)
    border-radius: $switch-size
    cursor: pointer
    transition: .2s
    box-shadow: 0 1px 2px rgba(0,0,0,.1) inset
    &:hover
      background-color: rgba(0,0,0,.24)
    &:after
      display: block
      content: ''
      position: absolute
      left: -$switch-size*.03
      top: -$switch-size*.03
      width: $switch-size/2
      height: $switch-size/2
      border-radius: 50%
      background-color: #fff
      box-shadow: 0 2px 4px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.04)
      transition: .2s ease-in

// just for layout
body
  position: absolute
  width: 100%
  height: 100%
  overflow: hidden
.switch
  margin: 0 auto
  top: 50%
  transform: translateY(-50%)
              
            
!

JS

              
                
              
            
!
999px

Console