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

              
                .toggleWrapper
	input(type="checkbox")#dn.dn
	label(for="dn").toggle
		span.toggle__handler

              
            
!

CSS

              
                =transition($property: all)
  transition: $property 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95)

$gray: #EDF0F4
$red: #D21626
$green: #66B317

body
  background-color: $gray
  font-family: 'Helvetica Rounded', 'Arial Rounded MT Bold','Montserrat', sans-serif
  color: #fff

.toggleWrapper
  position: absolute
  top: 50%
  left: 50%
  overflow: hidden
  transform: translate3d(-50%, -50%, 0)
  input
    position: absolute
    left: -99em

.toggle
  cursor: pointer
  display: inline-block
  position: relative
  width: 120px
  height: 50px
  background: $red
  //border: 4px solid darken($gray, 10%)
  border-radius: 5px

  +transition
  &:before, &:after
    position: absolute
    line-height: 50px
    font-size: 14px
    z-index: 2
    +transition
  &:before 
    content: 'OFF'
    left: 20px
    color: $red
 
  &:after 
    content: 'ON'
    right: 20px
    color: #fff
  
.toggle__handler
  display: inline-block
  position: relative
  z-index: 1
  background: #fff
  width: 65px
  height: 44px
  border-radius: 3px
  top: 3px
  left: 3px
  +transition
  transform: translateX(0px)

input:checked
  + .toggle
    background: $green
    &:before
      color: #fff
    &:after
      color: $green
    .toggle__handler
      width: 54px
      transform: translateX(60px)
      border-color: #fff

              
            
!

JS

              
                
              
            
!
999px

Console