Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <section class='wrap' data-descr='initial element + how path is drawn'>
  <div class='no-clip'></div>
  <svg viewbox='0 0 300 300'>
      <clipPath id='cp' clipPathUnits='objectBoundingBox'>
        <polygon points='0,0 1,0 1,1 0,1 
                         .1,.1 .5,.5 .9,.1
    <polygon points='0,0 300,0 300,300 0,300 
                     30,30 150,150 270,30

<section class='wrap' data-descr='clip: use polygon() function (WebKit only)'>
  <div class='clip-me'></div>

<section class='wrap' data-descr='clip: use reference to a <clipPath> element to clip an HTML element (Firefox + WebKit browsers)'>
  <div class='clip-me'></div>

<section class='wrap' data-descr='clip: use reference to a <clipPath> element to clip an SVG <rect> element (works in IE as well)'>
    <rect width='300' height='300' class='clip-me'/>
              @import "compass/css3";

.wrap {
  display: inline-block;
  position: relative;
  margin: 4px 4px 3em;
  width: 300px; height: 300px;
  box-shadow: 0 0 2px 2px;
  & > * {
    position: absolute;
    top: 0; left: 0;
    width: inherit; height: inherit;
  &:nth-child(2) .clip-me {
    clip-path: polygon(
      0 0, 300px 0, 300px 300px, 0 300px,
      0 0, 
      30px 30px, 150px 150px, 270px 30px,
      30px 30px
  &:nth-child(n + 3) .clip-me {
    clip-path: url(#cp);
  &:after {
    position: absolute;
    top: 100%;
    padding: .5em 0;
    font: 1em trebuchet ms, verdana, sans-serif;
    content: attr(data-descr);

div {
  &.no-clip, &.clip-me {
    background: #222

rect { fill: #222 }

.drawing {
  fill: rgba(#be4c39, .01);
  stroke: #da8817;
  stroke-width: 4;
  stroke-dasharray: 1870;
  stroke-dashoffset: 1870;
  animation: ani 4s linear infinite;

@keyframes ani {
  79% { fill: rgba(#be4c39, .01); }
  80%, 100% {
    fill: rgba(#be4c39, .35);
    stroke-dashoffset: 0;
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.