Pen Settings

HTML

CSS

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

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

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.

HTML

              
                - var colors = [
-  'red',
-  'orange',
-  'yellow',
-  'green',
-  'blue',
-  'indigo',
-  'violet'
- ]

h1 Color Picker
p HTML/CSS-only color picker concept.
.colorPicker
  each color in colors
    - var pickerId = "hat-color"
    input(type='radio' name=pickerId value=color class=color id=pickerId + "-" + color)
    label(for=pickerId + "-" + color, class=color)= color
              
            
!

CSS

              
                red    = #ff3e05
orange = #ff8d05
yellow = #ecca05
green  = #40af04
blue   = #057fff
indigo = #7500ca
violet = #cc6fcc

*
  box-sizing border-box

html
  display table
  width 100%
  height 100%

body
  text-align center
  display table-cell
  vertical-align middle
  padding 1em
  background whitesmoke
  font 100%/1.2 "Helvetica Neue"
  font-weight 200

.colorPicker
  margin-top 1em
  font-size 0.875em
  text-align center
  display inline-table
  width 100%
  max-width 40em
  background white
  padding 2px
  border-radius 0.35em
  box-shadow 0 0.5em 1.5em rgba(black, 0.15)

  label
    -webkit-tap-highlight-color rgba(white, 0.5)
    transition all 0.2s ease-in-out
    display table-cell
    cursor pointer
    vertical-align middle
    padding 0.5em 1em
    text-transform capitalize
    letter-spacing -0.5em
    color transparent
    opacity 0.35
    width 1%
    background-image linear-gradient(rgba(white, 0.1), rgba(black, 0.1))
    
    &.red
      background-color red
      -webkit-tap-highlight-color red
    &.orange
      background-color orange
      -webkit-tap-highlight-color orange
    &.yellow
      background-color yellow
      -webkit-tap-highlight-color yellow
    &.green
      background-color green
      -webkit-tap-highlight-color green
    &.blue
      background-color blue
      -webkit-tap-highlight-color blue
    &.indigo
      background-color indigo
      -webkit-tap-highlight-color indigo
    &.violet
      background-color violet
      -webkit-tap-highlight-color violet
    
    &:first-of-type
      border-radius 0.25em 0 0 0.25em
    &:last-of-type
      border-radius 0 0.25em 0.25em 0
    
    &:hover
      opacity 1
      color white
      letter-spacing normal
      
  input
    display none
    &:checked
      & + label
        width 90%
        opacity 1
        color white
        letter-spacing normal
  
              
            
!

JS

              
                
              
            
!
999px

Console