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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <header>
  <h1>Pantone Fashion Colors</h1>
  <p>Spring 2014</p>
</header>

<table>
  <col />
  <col />
  <col />
  <thead>
    <tr>
      <th scope="col">Pantone Color</th>
      <th scope="col">CMYK</th>
      <th scope="col">HEX</th>
    </tr>
  </thead>
  <tbody>

  <tr>
    <th scope="row">15-3920 Placid Blue</th>
    <td>47.17.2.0</td>
    <td>#87d4fa</td>
  </tr>
  <tr>
    <th scope="row">16-3823 Violet Tulip</th>
    <td>44.39.0.0</td>
    <td>#8f9cff</td>
  </tr>
  <tr>
    <th scope="row">15-6114 Hemlock</th>
    <td>39.4.35.0</td>
    <td>#9cf5a6</td>
  </tr>
  <tr>
    <th scope="row">16-0000 Paloma</th>
    <td>35.24.27.0</td>
    <td>#a6c2ba</td>
  </tr>
  <tr>
    <th scope="row">15-1225 Sand</th>
    <td>20.27.48.0</td>
    <td>#ccba85</td>
  </tr>
  <tr>
    <th scope="row">14-0852 Freesia</th>
    <td>0.14.100.0</td>
    <td>#ffdb00</td>
  </tr>
  <tr>
    <th scope="row">18-1651 Cayenne</th>
    <td>6.74.56.0</td>
    <td>#f04270</td>
  </tr>
  <tr>
    <th scope="row">17-1360 Celosia Orange</th>
    <td>0.63.80.0</td>
    <td>#ff5e33</td>
  </tr>
  <tr>
    <th scope="row">18-3224 Radiant Orchid</th>
    <td>32.65.0.0</td>
    <td>#ad59ff</td>
  </tr>
  <tr>
    <th scope="row">18-3949 Dazzling Blue</th>
    <td>92.57.0.0</td>
    <td>#146eff</td>
  </tr>
  <tr>
    <th scope="row">18-3718 Purple Haze</th>
    <td>56.51.15.0</td>
    <td>#707dd9</td>
  </tr>
  <tr>
    <th scope="row">18-6216 Comfrey</th>
    <td>74.28.63.10</td>
    <td>#3ca555</td>
  </tr>
  <tr>
    <th scope="row">19-2428 Magenta Purple</th>
    <td>51.94.24.24</td>
    <td>#752563</td>
  </tr>   
    
  </tbody>
  <tfoot>
    <tr>
      <td><a href="https://codepen.io/atelierbram/pen/hdbjc">on CodePen</a></td>
      <td></td>
      <td></td>
    </tr>
  </tfoot>
</table>
<footer>
  <ul>
    <li><a href="http://www.pantone.com/downloads/support/FCR/PANTONE_FCR_Spring_2014.pdf">Fashion Color Report 2014 (PDF direct link)</a></li>
    <li><a href="http://web.forret.com/tools/color.asp">CMYK to RGB converter</a></li>
    <li><a href="https://atelierbram.github.io/c-tiles16/colorscheming/">Play with this colorscheme, or make your own with c-Tiles16</a></li>
  </ul>
</footer>
              
            
!

CSS

              
                $placid-blue:    #87d4fa;
$violet-tulip:   #8f9cff;
$hemlock:        #9cf5a6;
$paloma:         #a6c2ba;
$sand:           #ccba85;
$freesia:        #ffdb00;
$cayenne:        #f04270;
$celosia-orange: #ff5e33;
$radiant-orchid: #ad59ff;
$dazzling-blue:  #146eff;
$purple-haze:    #707dd9;
$comfrey:        #3ca555;
$magenta-purple: #752563;

$blue-light: $placid-blue;
$electric-ladyland: $violet-tulip;
$green-light: $hemlock;
$gray: $paloma;
$ocre-light: $sand;
$yellow: $freesia;
$red: $cayenne;
$orange: $celosia-orange;
$violet: $radiant-orchid;
$blue-dark: $dazzling-blue;
$jimi-hendrix: $purple-haze;
$green: $comfrey;
$magenta-dark: $magenta-purple;

$gray-light: lighten($gray,25%);

// https://codepen.io/MadeByMike/pen/sDpxg/
// Adapted from: https://gist.github.com/voxpelli/6304812
@function luma($color){
  $rgba: red($color), green($color), blue($color);
  $rgba2: ();
  @for $i from 1 through 3 {
    $rgb: nth($rgba, $i);
    $rgb: $rgb / 255;
    $rgb: if($rgb < .03928, $rgb / 12.92, pow(($rgb + .055) / 1.055, 2.4));
    $rgba2: append($rgba2, $rgb);
  }
  @return (.2126 * nth($rgba2, 1) + .7152 * nth($rgba2, 2) + 0.0722 * nth($rgba2, 3))*100;
}
@function contrast_ratio($color1, $color2) {
  $luma1: luma($color1) + 5;
  $luma2: luma($color2) + 5;
  $ratio: $luma1 / $luma2;
  @if $luma1 < $luma2 {
    $ratio: 1 / $ratio;
  }
  @return $ratio;
}

@function text-contrast($color, $bgcolor: $color) {
  $threshold: 4.5; // 4.5 = WCAG AA,7= WCAG AAA
  $list: 20 30 40 50 60 70 80 90 100;
  @each $percent in $list {
    $lighter: lighten($bgcolor, $percent);
    $darker: darken($bgcolor, $percent);
    $darker-ratio: contrast_ratio($color, $darker);
    $lighter-ratio: contrast_ratio($color, $lighter);
    @if($lighter-ratio > $darker-ratio){
      @if ($lighter-ratio > $threshold){
        @return $lighter;
      }
    }
    @if($darker-ratio > $lighter-ratio){
      @if ($darker-ratio > $threshold){
        @return $darker;
      }
    }
  }
  @return if(lightness($color) < 51, #FFF, #000)
}

* {
  // outline: 1px dotted salmon;
  margin: 0;
  padding: 0;
  vertical-align: baseline;
  box-sizing: border-box;
}
html {
  background: $gray-light;
  animation-name: bg-color;
  animation-duration: 90s;
  animation-fill-mode: both;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
body {
  font: 100%/1.5 AvenirNextCondensed-Regular, Calibri, Corbel, "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Tahoma, Verdana, sans-serif;
  margin: 0 auto;
  padding: 1em;
  padding-bottom: 3em;
  max-width: 35em;
  color: #111;
}
h1,
header p {
  letter-spacing: -1px;
  word-spacing: 1px;
  line-height: 1;
  font-size: 2.2em;
  padding: 0 16px;
  animation-name: color;
  animation-duration: 90s;
  animation-fill-mode: both;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
h1 {
  color: $jimi-hendrix;
  text-transform: capitalize;

}
header {
  padding-bottom: 3em;
}
header p {
  color: $electric-ladyland;
  font-size: 1.75em;
  text-align: right;
  transform: translateY(-100%);
}
table {
  border-collapse: collapse;
  border-spacing: 0;
  font-family: Consolas, Menlo, Monaco, monospace;
  background: $gray;
}

col:nth-of-type(1) {
  background: rgba(0,0,0,.125);
  width: 62.5%;
}
col:nth-of-type(2) {
  width: 20%;
}
col:nth-of-type(3) {
  width: 17.5%;
}
thead {
  display: table-header-group;
}
header,
thead th {
  font-family: AvenirNextCondensed-DemiBold, Calibri, Corbel, "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Tahoma, Verdana, sans-serif;
  font-weight: 700;
}
.wf-active header,
.wf-active thead th {
  font-family: Cuprum, AvenirNextCondensed-DemiBold, Calibri, Corbel, "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Tahoma, Verdana, sans-serif;
}
thead th {
  border-bottom: 1px solid #333;
  text-align: right;
  font-size: 1.125em;
  background: lighten($gray,10%);
  text-transform: uppercase;
}
thead th:nth-of-type(1) {
  text-align: left;
}

th[scope="col"] {
  border-bottom: 3px solid $gray;
}
th[scope="row"] {
  text-align: left;
}
th, td {
  padding: .5em 1em;
}
td:nth-of-type(1) {
  text-align: right;
}
td:nth-of-type(2) {
  text-align: right;
}
tr:nth-of-type(1) {
  background: $placid-blue;
  color: text-contrast($placid-blue);
}
tr:nth-of-type(2) {
  background: $violet-tulip;
  color: text-contrast($violet-tulip);
}
tr:nth-of-type(3) {
  background: $hemlock;
  color: text-contrast($hemlock);
}
tr:nth-of-type(4) {
  background: $paloma;
  color: text-contrast($paloma);
}
tr:nth-of-type(5) {
  background: $sand;
  color: text-contrast($sand);
}
tr:nth-of-type(6) {
  background: $freesia;
  color: text-contrast($freesia);
}
tr:nth-of-type(7) {
  background: $cayenne;
  color: text-contrast($cayenne);
}
tr:nth-of-type(8) {
  background: $celosia-orange;
  color: text-contrast($celosia-orange);
}
tr:nth-of-type(9) {
  background: $radiant-orchid;
  color: text-contrast($radiant-orchid);
}
tr:nth-of-type(10) {
  background: $dazzling-blue;
  color: text-contrast($dazzling-blue);
}
tr:nth-of-type(11) {
  background: $purple-haze;
  color: text-contrast($purple-haze);
}
tr:nth-of-type(12) {
  background: $comfrey;
  color: text-contrast($comfrey);
}
tr:nth-of-type(13) {
  background: $magenta-purple;
  color: text-contrast($magenta-purple);
}

ul {
  list-style: none;
}
a {
  color: $blue-dark;
  display: inline-block;
  padding: .25em 0;
  text-decoration: none;
}
a:hover {
  color: $magenta-purple;
}
footer,
footer ul {
  overflow: auto;
}
footer {
  margin: 0 auto;
  border-top: 3px solid shade($gray,15%);
  padding: 2em 1em 1em;
  background: $gray;
}
footer li {
  font-size: .875em;
  text-align: center;
}
footer a {
  float: left;
  width: 100%;
}
@keyframes bg-color {
  0% {
    background: #fff;
  }
  6% {
    background: #fff;
  }
  6.6% {
    background: $blue-light;
  }
  12.6% {
    background: $blue-light;
  }
  13.2% {
    background: $electric-ladyland;
  }
  19.2% {
    background: $electric-ladyland;
  }
  19.8% {
    background: $green-light;
  }
  25.8% {
    background: $green-light;
  }
  26.4% {
    background: $gray;
  }
  32.4% {
    background: $gray;
  }
  33% {
    background: $ocre-light;
  }
  39% {
    background: $ocre-light;
  }
  39.6% {
    background: $yellow;
  }
  45.6% {
    background: $yellow;
  }
  46.2% {
    background: $red;
  }
  52.2% {
    background: $red;
  }
  52.8% {
    background: $orange;
  }
  58.8% {
    background: $orange;
  }
  59.4% {
    background: $violet;
  }
  65.4% {
    background: $violet;
  }
  66% {
    background: $blue-dark;
  }
  72% {
    background: $blue-dark;
  }
  72.6% {
    background: $jimi-hendrix;
  }
  78.6% {
    background: $jimi-hendrix;
  }
  79.2% {
    background: $green;
  }
  85.2% {
    background: $green;
  }
  85.8% {
    background: $magenta-dark;
  }
  91.8% {
    background: $magenta-dark;
  }
  92.4% {
    background: $gray-light;
  }
}

@keyframes color {
  0% {
    color: $red;
  }
  6% {
    color: $red;
  }
  6.6% {
    color: $violet;
  }
  12.6% {
    color: $violet;
  }
  13.2% {
    color:  white;
  }
  19.2% {
    color:  white;
  }
  19.8% {
    color: $orange;
  }
  25.8% {
    color: $orange;
  }
  26.4% {
    color: $yellow;
  }
  32.4% {
    color: $yellow;
  }
  33% {
    color: $magenta-dark;
  }
  39% {
    color: $magenta-dark;
  }
  39.6% {
    color: $blue-dark;
  }
  45.6% {
    color: $blue-dark;
  }
  46.2% {
    color: $gray-light;
  }
  52.2% {
    color: $gray-light;
  }
  52.8% {
    color: $green-light;
  }
  58.8% {
    color: $green-light;
  }
  59.4% {
    color: $blue-light;
  }
  65.4% {
    color: $blue-light;
  }
  66% {
    color: $electric-ladyland;
  }
  72% {
    color: $electric-ladyland;
  }
  72.6% {
    color: $gray;
  }
  78.6% {
    color: $gray;
  }
  79.2% {
    color: $ocre-light;
  }
  85.2% {
    color: $ocre-light;
  }
  85.8% {
    color: $jimi-hendrix;
  }
  91.8% {
    color: $jimi-hendrix;
  }
  92.4% {
    color: $gray;
  }
}
              
            
!

JS

              
                /*
  For a colortable with blending go to https://codepen.io/atelierbram/pen/xJhct
* you can make your own colorscheme with c-Tiles: 
* https://atelierbram.github.io/c-tiles16/colorscheming/#7b8a8e
*/
WebFontConfig = {
    google: { families: [ 'Cuprum::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