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 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

              
                <div>
<input type="checkbox" name="toggle">
</div>
              
            
!

CSS

              
                $ts-speed = .7s

body
  height 100vh
  display flex
  align-items center
  justify-content center
  background-color #514878
  
 div
   transform scale(0.25)
    
  
  input
    height 110px
    width 220px
    position relative
    cursor pointer
    appearance none
    background-color #39315a
    border-radius 100px
    display block
    outline none
    box-shadow: 
      inset 0 0 20px rgba(#000,0.2),
      inset 0 0 5px -2px rgba(#000,0.4)
      
    &:before
      content ''
      height 90px
      width 90px
      background-color #6b6394
      background-image:
radial-gradient(ellipse at 50% 50% ,  rgba(255,255,255,.3) 20%, transparent 70%),
radial-gradient(ellipse at 50% 50% ,  rgba(255,255,255,.2) 0%, transparent 70%),
radial-gradient(ellipse at 50% 50% , transparent 30%, rgba(255,255,255,.1) 70%, transparent 70%),
radial-gradient(transparent 6px, rgba(0,0,0,.3) 7px, transparent 17px, rgba(0,0,0,.3) 18px, rgba(0,0,0,.1)),
radial-gradient(ellipse at 50% 50% ,  rgba(255,255,255,.06) 70%, transparent 70%),
linear-gradient(30deg, transparent 7px, rgba(255,255,255,.3) 9px, transparent 11px),
linear-gradient(70deg, transparent 7px, rgba(255,255,255,.3) 9px, transparent 11px)
      background-size: 20% 70%, 40% 80%, 60% 80%, 100%, 100%, 8px 10px, 10px 12px
      background-position: 52% -30px, 35% -30px, 0% -20px, 50%, -50px 55px, 85% 25%, 91% 33%
      background-repeat: no-repeat
      border-radius 50%
      position relative
      top 10px
      left 10px
      display block
      transition $ts-speed
      box-shadow:
        inset 0 0 1px 3px rgba(255,255,255,.1),
        inset 0 0 12px 18px rgba(0,0,0,.1),
        inset 0 0 0 30px rgba(#fdb843,0),
        inset 0 0 0 30px rgba(#fef401,0),
        0 20px 30px -10px rgba(#000,0.4)

    &:checked:before
      left 120px
      background-color #fef401
      box-shadow:
        inset 0 0 1px 3px #a56758,
        inset 0 0 12px 12px #6b454f,
        inset 0 0 3px 18px rgba(#fdb843,.1),
        inset 0 0 0 30px rgba(#fef401,.2),
        0 20px 30px -10px rgba(#000,0.4),
        0 0 30px 50px rgba(#fdb843,.1)
    
    &:after
      content ''
      position absolute
      display block
      height 36px
      width 36px
      color #4a426b
      border-radius 50%
      top 50%
      left 55px
      transition $ts-speed
      transform translate(-50%, -50%)
      background:
        radial-gradient(transparent 6px, currentColor 8px, transparent 9px),
        radial-gradient(transparent 6px, currentColor 8px, transparent 9px),
        radial-gradient(transparent 6px, currentColor 8px, transparent 9px),
        radial-gradient(transparent 6px, currentColor 8px, transparent 9px)
      background-repeat no-repeat
      background-size 16px 16px
      background-position: -9px 6px, 29px 6px, 2px -7px, 18px -7px
    
    &:checked:after
      left 165px
      color #fef4d5
      animation sparks 1s ease-in-out
      animation-delay: .4s

@keyframes sparks
  0%
    box-shadow:
      #d1b82b 30px -20px 0 -17px,
      #d1b82b 30px 15px 0 -17px,
      #d1b82b -27px 27px 0 -17px,
      #d1b82b -30px -2px 0 -17px
  30%
    box-shadow:
      #d1b82b 60px -30px 0 -16px,
      #d1b82b 50px 30px 0 -16px,
      #d1b82b -50px 50px 0 -16px,
      #d1b82b -60px -10px 0 -16px
  100%
    box-shadow:
      transparent 100px -40px 0 -17px,
      transparent 80px 50px 0 -17px,
      transparent -70px 80px 0 -17px,
      transparent -80px -20px 0 -17px
              
            
!

JS

              
                
              
            
!
999px

Console