cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              .wrapper
  input#dn type="checkbox"
  label.toggle for="dn"
    span.toggle--handler
            
          
!
            
              //Mixins
=transition($property: all)
  transition: $property 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95)
=size($w, $h: $w)
  width: $w
  height: $h
=center
  position: absolute
  top: 50%
  left: 50%
  transform: translate(-50%, -50%) 
=resetPseudo
  content: ''
  position: absolute


label > *
  transform: translateZ(0) scale(1.0, 1.0)
.wrapper > *
  cursor: pointer
.wrapper
  +center
  +size(150px, 75px)
  background: #F1F1F1
  box-shadow: inset 0px 0px 5px 0px rgba(0,0,0,0.10)
  border-radius: 75px
  .toggle--handler
    background: linear-gradient(to bottom, #F5515F , #CD2942)
    +size(60px)
    display: block
    box-shadow: 0px 5px 40px rgba(#F5515F, .8) 
    border-radius: 60px
    margin: 7.5px
    position: relative
    z-index: 2
    +transition
    &:after
      +resetPseudo
      border-radius: 60px
      background: linear-gradient(to bottom, #468EFF , #2B68FF)
      +size(100%)
      opacity: 0
      transition: all 200ms
    &:before
      +resetPseudo
      +center
      +size(24px)
      border-radius: 60px
      background-image: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>assets/icons/cross</title><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z"/><path d="M0 0h24v24H0z"/><path d="M13.414 11.96l6.546-6.546L18.545 4 12 10.545 5.455 4 4.04 5.414l6.546 6.546-6.89 6.89 1.414 1.413 6.89-6.89 6.89 6.89 1.414-1.414-6.89-6.89z" fill="#FFF"/></g></svg>')
      transition: all 200ms
      transform: translate(-50%, -50%) rotate(180deg)
  &:after
    +resetPseudo
    +center
    +size(80px, 2px)
    background: #E5E5E5
    pointer-events: none

input
  position: absolute
  left: -999em
  &:checked
    + .toggle
      .toggle--handler
        transform: translateX(75px)
        background: linear-gradient(to bottom, #468EFF , #2B68FF)
        box-shadow: 0px 5px 40px rgba(#468EFF, .8) 
        &:after
          opacity: 1
        &:before
          background-image: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>assets/icons/cross copy</title><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z"/><path d="M0 0h24v24H0z"/><path fill="#FFF" d="M8.293 16.707l.707.707.707-.707 11-11-1.414-1.414-11 11h1.414l-4-4-1.414 1.414z"/></g></svg>')
          z-index: 5
          transform: translate(-50%, -50%) rotate(00deg)
            
          
!
            
              // Source:
// https://dribbble.com/shots/3075312-On-Off-Switch-Daily-UI-015
// Design by: Catalin Vasile

//✌️
            
          
!
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.
Loading ..................

Console