Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


  //- The colors
  - const colors = ['transparent', '#f22613', '#e74c3c', '#f62459', '#663399', '#9a12b3', '#bf55ec', '#19b5fe', '#1e8bc3', '#1f3a93', '#89c4f4', '#03c9a9', '#26c281', '#16a085', '#2eec71', '#f2784b', '#f89406', '#f9bf3b']
    - for (let i = 0; i < colors.length; i++)
      label.lighten(title=`Lighten w/ ${colors[i]}`, class=`${colors[i] === 'transparent' ? 'clear' : ''}`, for=`lighten--${i}`, style=`--bg: ${colors[i]}; --angle: ${(360 / colors.length) * i}`)
      input(id=`lighten--${i}`, type='radio', value=`${colors[i]}`, name='lighten', style=`--angle: ${(360 / colors.length) * i}`)
    - for (let i = 0; i < colors.length; i++)
      label.darken(title=`Darken w/ ${colors[i]}`, class=`${colors[i] === 'transparent' ? 'clear' : ''}`, for=`darken--${i}`, style=`--bg: ${colors[i]}; --angle: ${(360 / colors.length) * i}`)
      input(id=`darken--${i}`, type='radio', value=`${colors[i]}`, name='darken', style=`--angle: ${(360 / colors.length) * i}`)
  svg.indicator(preserveAspectRatio='xMinYMin', viewBox="0 0 24 24")


  box-sizing border-box

  background-color #111
  min-height 100vh
  overflow hidden
  overflow-y scroll
  display flex
  align-items center
  justify-content center

$duration = .25s
$border = 4px

  background linear-gradient(45deg, #aaa, #111)
  width 100vw
  height 100vh
  min-height 550px
  position relative
  background url(',cat'), linear-gradient(45deg, #111, #aaa)
  background-size cover
  border-radius 100%
  height 220px
  left 50%
  overflow hidden
  position absolute
  top 50%
  transform translate(-50%, -50%)
  width 220px

    bottom 0
    content ''
    left 0
    position absolute
    right 0
    top 0
    transition background $duration $duration

    background var(--lighten)
    mix-blend-mode lighten

    background var(--darken)
    mix-blend-mode darken

  height 40px
  left 50%
  position absolute
  top 50%
  transform translate(-50%, -260px)
  width 40px
    fill #fff

  display none

  position absolute
  top 50%
  left 50%
  transform rotate(calc(((var(--selectedRotation, 0) * -1) - 90) * 1deg))
  transition transform $duration ease

  background var(--bg)
  border $border solid #fafafa
  border-radius 100%
  cursor pointer
  height 44px
  left 50%
  position absolute
  top 50%
  transform translate(-50%, -50%) rotate(calc(var(--angle) * 1deg)) translateX(150px)
  width 44px

    transform translate(-50%, -50%) rotate(calc(var(--angle) * 1deg)) translateX(200px)

  border-color red
  border-width $border
  overflow hidden

    background #f22613
    content ''
    height $border
    left 50%
    position absolute
    top 50%
    transform translate(-50%, -50%) rotate(45deg)
    width 100%



                const duotone = document.querySelector('.duotone')
const choosers = {
  darken: document.querySelector('.chooser--darken'),
  lighten: document.querySelector('.chooser--lighten'),
const updateTone = (e) => {
  const {
  } =`--${name}`, value)
document.body.addEventListener('input', updateTone)
document.body.addEventListener('change', updateTone)