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

              
                ul
  li.aqua aqua
  li.aliceblue aliceblue
  li.antiquewhite antiquewhite
  li.black black
  li.blue blue
  li.cyan cyan
  li.darkblue darkblue
  li.darkcyan darkcyan
  li.darkgreen darkgreen
  li.darkturquoise darkturquoise
  li.deepskyblue deepskyblue
  li.green green
  li.lime lime
  li.mediumblue mediumblue
  li.mediumspringgreen mediumspringgreen
  li.navy navy
  li.springgreen springgreen
  li.teal teal
  li.midnightblue midnightblue
  li.dodgerblue dodgerblue
  li.lightseagreen lightseagreen
  li.forestgreen forestgreen
  li.seagreen seagreen
  li.darkslategray darkslategray
  li.darkslategrey darkslategrey
  li.limegreen limegreen
  li.mediumseagreen mediumseagreen
  li.turquoise turquoise
  li.royalblue royalblue
  li.steelblue steelblue
  li.darkslateblue darkslateblue
  li.mediumturquoise mediumturquoise
  li.indigo indigo
  li.darkolivegreen darkolivegreen
  li.cadetblue cadetblue
  li.cornflowerblue cornflowerblue
  li.mediumaquamarine mediumaquamarine
  li.dimgray dimgray
  li.dimgrey dimgrey
  li.slateblue slateblue
  li.olivedrab olivedrab
  li.slategray slategray
  li.slategrey slategrey
  li.lightslategray lightslategray
  li.lightslategrey lightslategrey
  li.mediumslateblue mediumslateblue
  li.lawngreen lawngreen
  li.aquamarine aquamarine
  li.chartreuse chartreuse
  li.gray gray
  li.grey grey
  li.maroon maroon
  li.olive olive
  li.purple purple
  li.lightskyblue lightskyblue
  li.skyblue skyblue
  li.blueviolet blueviolet
  li.darkmagenta darkmagenta
  li.darkred darkred
  li.saddlebrown saddlebrown
  li.darkseagreen darkseagreen
  li.lightgreen lightgreen
  li.mediumpurple mediumpurple
  li.darkviolet darkviolet
  li.palegreen palegreen
  li.darkorchid darkorchid
  li.yellowgreen yellowgreen
  li.sienna sienna
  li.brown brown
  li.darkgray darkgray
  li.darkgrey darkgrey
  li.greenyellow greenyellow
  li.lightblue lightblue
  li.paleturquoise paleturquoise
  li.lightsteelblue lightsteelblue
  li.powderblue powderblue
  li.firebrick firebrick
  li.darkgoldenrod darkgoldenrod
  li.mediumorchid mediumorchid
  li.rosybrown rosybrown
  li.darkkhaki darkkhaki
  li.silver silver
  li.mediumvioletred mediumvioletred
  li.indianred indianred
  li.peru peru
  li.chocolate chocolate
  li.tan tan
  li.lightgray lightgray
  li.lightgrey lightgrey
  li.thistle thistle
  li.goldenrod goldenrod
  li.orchid orchid
  li.palevioletred palevioletred
  li.crimson crimson
  li.gainsboro gainsboro
  li.plum plum
  li.burlywood burlywood
  li.lightcyan lightcyan
  li.lavender lavender
  li.darksalmon darksalmon
  li.palegoldenrod palegoldenrod
  li.violet violet
  li.azure azure
  li.honeydew honeydew
  li.khaki khaki
  li.lightcoral lightcoral
  li.sandybrown sandybrown
  li.beige beige
  li.mintcream mintcream
  li.wheat wheat
  li.whitesmoke whitesmoke
  li.ghostwhite ghostwhite
  li.lightgoldenrodyellow lightgoldenrodyellow
  li.linen linen
  li.salmon salmon
  li.oldlace oldlace
  li.bisque bisque
  li.blanchedalmond blanchedalmond
  li.coral coral
  li.cornsilk cornsilk
  li.darkorange darkorange
  li.deeppink deeppink
  li.floralwhite floralwhite
  li.fuchsia fuchsia
  li.gold gold
  li.hotpink hotpink
  li.ivory ivory
  li.lavenderblush lavenderblush
  li.lemonchiffon lemonchiffon
  li.lightpink lightpink
  li.lightsalmon lightsalmon
  li.lightyellow lightyellow
  li.magenta magenta
  li.mistyrose mistyrose
  li.moccasin moccasin
  li.navajowhite navajowhite
  li.orange orange
  li.orangered orangered
  li.papayawhip papayawhip
  li.peachpuff peachpuff
  li.pink pink
  li.red red
  li.seashell seashell
  li.snow snow
  li.tomato tomato
  li.white white
  li.yellow yellow
  li.rebeccapurple rebeccapurple
              
            
!

CSS

              
                $contrast-settings: (
  'light-color': #000,
  'dark-color': #fff,
  'light-ratio': 30%
);

$css-colors: (
  'aqua': #00ffff,
  'aliceblue': #f0f8ff,
  'antiquewhite': #faebd7,
  'black': #000000,
  'blue': #0000ff,
  'cyan': #00ffff,
  'darkblue': #00008b,
  'darkcyan': #008b8b,
  'darkgreen': #006400,
  'darkturquoise': #00ced1,
  'deepskyblue': #00bfff,
  'green': #008000,
  'lime': #00ff00,
  'mediumblue': #0000cd,
  'mediumspringgreen': #00fa9a,
  'navy': #000080,
  'springgreen': #00ff7f,
  'teal': #008080,
  'midnightblue': #191970,
  'dodgerblue': #1e90ff,
  'lightseagreen': #20b2aa,
  'forestgreen': #228b22,
  'seagreen': #2e8b57,
  'darkslategray': #2f4f4f,
  'darkslategrey': #2f4f4f,
  'limegreen': #32cd32,
  'mediumseagreen': #3cb371,
  'turquoise': #40e0d0,
  'royalblue': #4169e1,
  'steelblue': #4682b4,
  'darkslateblue': #483d8b,
  'mediumturquoise': #48d1cc,
  'indigo': #4b0082,
  'darkolivegreen': #556b2f,
  'cadetblue': #5f9ea0,
  'cornflowerblue': #6495ed,
  'mediumaquamarine': #66cdaa,
  'dimgray': #696969,
  'dimgrey': #696969,
  'slateblue': #6a5acd,
  'olivedrab': #6b8e23,
  'slategray': #708090,
  'slategrey': #708090,
  'lightslategray': #778899,
  'lightslategrey': #778899,
  'mediumslateblue': #7b68ee,
  'lawngreen': #7cfc00,
  'aquamarine': #7fffd4,
  'chartreuse': #7fff00,
  'gray': #808080,
  'grey': #808080,
  'maroon': #800000,
  'olive': #808000,
  'purple': #800080,
  'lightskyblue': #87cefa,
  'skyblue': #87ceeb,
  'blueviolet': #8a2be2,
  'darkmagenta': #8b008b,
  'darkred': #8b0000,
  'saddlebrown': #8b4513,
  'darkseagreen': #8fbc8f,
  'lightgreen': #90ee90,
  'mediumpurple': #9370db,
  'darkviolet': #9400d3,
  'palegreen': #98fb98,
  'darkorchid': #9932cc,
  'yellowgreen': #9acd32,
  'sienna': #a0522d,
  'brown': #a52a2a,
  'darkgray': #a9a9a9,
  'darkgrey': #a9a9a9,
  'greenyellow': #adff2f,
  'lightblue': #add8e6,
  'paleturquoise': #afeeee,
  'lightsteelblue': #b0c4de,
  'powderblue': #b0e0e6,
  'firebrick': #b22222,
  'darkgoldenrod': #b8860b,
  'mediumorchid': #ba55d3,
  'rosybrown': #bc8f8f,
  'darkkhaki': #bdb76b,
  'silver': #c0c0c0,
  'mediumvioletred': #c71585,
  'indianred': #cd5c5c,
  'peru': #cd853f,
  'chocolate': #d2691e,
  'tan': #d2b48c,
  'lightgray': #d3d3d3,
  'lightgrey': #d3d3d3,
  'thistle': #d8bfd8,
  'goldenrod': #daa520,
  'orchid': #da70d6,
  'palevioletred': #db7093,
  'crimson': #dc143c,
  'gainsboro': #dcdcdc,
  'plum': #dda0dd,
  'burlywood': #deb887,
  'lightcyan': #e0ffff,
  'lavender': #e6e6fa,
  'darksalmon': #e9967a,
  'palegoldenrod': #eee8aa,
  'violet': #ee82ee,
  'azure': #f0ffff,
  'honeydew': #f0fff0,
  'khaki': #f0e68c,
  'lightcoral': #f08080,
  'sandybrown': #f4a460,
  'beige': #f5f5dc,
  'mintcream': #f5fffa,
  'wheat': #f5deb3,
  'whitesmoke': #f5f5f5,
  'ghostwhite': #f8f8ff,
  'lightgoldenrodyellow': #fafad2,
  'linen': #faf0e6,
  'salmon': #fa8072,
  'oldlace': #fdf5e6,
  'bisque': #ffe4c4,
  'blanchedalmond': #ffebcd,
  'coral': #ff7f50,
  'cornsilk': #fff8dc,
  'darkorange': #ff8c00,
  'deeppink': #ff1493,
  'floralwhite': #fffaf0,
  'fuchsia': #ff00ff,
  'gold': #ffd700,
  'hotpink': #ff69b4,
  'ivory': #fffff0,
  'lavenderblush': #fff0f5,
  'lemonchiffon': #fffacd,
  'lightpink': #ffb6c1,
  'lightsalmon': #ffa07a,
  'lightyellow': #ffffe0,
  'magenta': #ff00ff,
  'mistyrose': #ffe4e1,
  'moccasin': #ffe4b5,
  'navajowhite': #ffdead,
  'orange': #ffa500,
  'orangered': #ff4500,
  'papayawhip': #ffefd5,
  'peachpuff': #ffdab9,
  'pink': #ffc0cb,
  'red': #ff0000,
  'seashell': #fff5ee,
  'snow': #fffafa,
  'tomato': #ff6347,
  'white': #ffffff,
  'yellow': #ffff00,
  'rebeccapurple': #663399
);

@mixin contrast-me($bg-color) {
  @if lightness($bg-color) < 60% {
    color: map-get($contrast-settings, 'dark-color');
  } @else {
    color: map-get($contrast-settings, 'light-color');
  }

  background-color: $bg-color;
}

ul {
  margin: 0;
  padding: 0;
}

li {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5em;
  padding: 2em;
  margin: .25em;
  text-align: center;
  list-style: none;
}

@each $color, $hex in $css-colors {
  .#{$color} {
    @include contrast-me($hex);
  }
}
              
            
!

JS

              
                // CSS Color names list here: https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json

// Google Font:
WebFontConfig = {
    google: { families: [ 'Montserrat::latin' ] }
  };
  (function() {
    var wf = document.createElement('script');
    wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
      '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
    wf.type = 'text/javascript';
    wf.async = 'true';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(wf, s);
})();
              
            
!
999px

Console