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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

              $red: #fd1a15
$green: #007177
$btnWidth: 116px
$switchWidth: 300px
$switchHeight: 130px
$padding: 7px

  box-sizing: border-box

html, body
  height: 100%

  display: flex
  align-items: center
  justify-content: center

  display: none

.checkbox + label
  display: inline-block
  position: relative
  width: $switchWidth
  height: $switchHeight
  background: linear-gradient(to right, $red 0, #fc8b34 45%, #7fd03e 55%, $green 100%) 0 0
  background-size: (($switchWidth * 2) + 50) 100%
  border-radius: 70px
  padding: $padding
  cursor: pointer
  transition: all 500ms ease
  box-shadow: 0 0px 10px rgba(0, 0, 0, 0.2) inset
    content: 'Off'
    width: $btnWidth
    height: $btnWidth
    position: absolute
    left: $padding
    top: $padding
    border-radius: 100%
    background: #fff
    text-align: center
    line-height: ($switchHeight - ($padding * 2))
    font-family: 'Cabin', sans-serif
    font-size: 35px
    font-weight: bold
    color: $red
    letter-spacing: 3px
    text-transform: uppercase
    transition: left 500ms ease, color 500ms ease, transform 150ms ease
      transform: scale(0.95)

.checkbox:checked + label
  background-position-x: -($switchWidth + 50)
    content: 'On'
    color: $green
    left: ($switchWidth - $btnWidth - $padding)

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................