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.


                # Layered box-shadows

Inspired by the original layered box-shadow technique by [Tobias Ahlin](

## Handwritten

<div class="shadow">
<div class="layered">


<div class="shadow-lg">
  Normal Lg
<div class="layered-lg">
  Layered Lg

## Generated by mixin
Diffused steps through each even number up to the specified count. The boolean multiply option will increment by a factor of 2.

<div class="mixin-sm">
  Diffused small (4)
<div class="mixin">
  Diffused medium (8)
<div class="mixin-lg">
  Diffused large (16)
<div class="mixin-xl">
  Multiplied extra large (16)


                .shadow {
  box-shadow: 0 3px 6px rgba(0,0,0,.25);

.layered {
  box-shadow: 0 1px 1px rgba(0,0,0,.125),
              0 2px 2px rgba(0,0,0,.125),
              0 4px 4px rgba(0,0,0,.125),
              0 8px 8px rgba(0,0,0,.125);

.shadow-lg {
  box-shadow: 0 16px 16px rgba(0,0,0,.25);

.layered-lg {
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075),
              0 2px 2px rgba(0, 0, 0, 0.075),
              0 4px 4px rgba(0, 0, 0, 0.075),
              0 8px 8px rgba(0, 0, 0, 0.075), 
              0 12px 12px rgba(0, 0, 0, 0.075), 
              0 16px 16px rgba(0, 0, 0, 0.075);

@function diffuse-shadows($size, $color: rgba(0,0,0,.125), $multiply: false) {
  $val: 0 1px 1px $color;
  @for $i from 1 through $size {
    @if $i % 2 == 0 {
      @if $multiply == true {
        $i: $i * 2;
      $val: #{$val}, 0 #{$i}px #{$i}px #{$color};
  @return $val;

@mixin diffuse($size, $color, $multiply) {
  box-shadow: diffuse-shadows($size, $color, $multiply);

.mixin-sm { @include diffuse(4, rgba(0,0,0,.1), false); }
.mixin    { @include diffuse(8, rgba(0,0,0,.075), false); }
.mixin-lg { @include diffuse(16, rgba(0,0,0,.05), false); }
.mixin-xl { @include diffuse(16, rgba(0,0,0,.05), true); }

// Demo page styles, ignore

body {
  padding: 2rem 2rem 4rem;
  margin: 0;
  font: 16px/1.5 -apple-system, sans-serif;
  color: #333;
  text-align: center;
  background-color: #f5f5f5;

h1, h2 {
  margin-bottom: .5rem;

p {
  margin-left: auto;
  margin-right: auto;
  max-width: 44rem;

[class^="mixin"] {
  display: inline-block;
  width: 8rem;
  padding: 3rem 2rem;
  margin: 1rem;
  background-color: #fff;
  border-radius: .25rem;