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

+ 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.


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.


                <h1>Composing box shadows with CSS variables demo</h1>
  The box shadows of the input fields below are brought by two classes `box-shadow--elevation` to lift it up the page and `box-shadow--inset` to give it a bit of depth inside. On focus, it gains a third box shadow to outline it with rounded corners.
  Instead of each class overriding the `box-shadow` property, a system of variables allow to compose them with each other so each class adds or remove a specific shadow.
<label for="input">Focus me</label>
<input class="box-shadow--elevation box-shadow--inset" id="input" name="field" />



                :root {
      /* Tobias Ahlin's smooth shadow: */
      --elevation: 0 0.125rem 0.125rem rgba(0,0,0,0.12), 
              0 0.25rem 0.25rem rgba(0,0,0,0.12),
              0 0.5rem 0.5rem
      --outline: 0 0 0 0.125rem #4d003a, ;
      --inset: inset 0 0.125rem 0.125rem hsla(0, 0%, 0%, 0.2), ;

    [class*="box-shadow"] {
      /* Lea Verou's empty var technique: */
      --shw__inset: ;
      --shw__outline: ;
      --shw__elevation: ;
      box-shadow: var(--shw__inset) var(--shw__outline) var(--shw__elevation) 0 0 0 transparent;

    .box-shadow--elevation {
      --shw__elevation: var(--elevation);

    .box-shadow--inset {
      --shw__inset: var(--inset);

    :focus {
      --shw__outline: var(--outline);
      /* Let's not forget Windows High Contrast mode which won't have the shadows for the focus */  
      outline: solid transparent 0.125rem;
      outline-offset: 0.125rem;

    input {
      border: solid 1px #4d003a;
      padding: 0.25rem;
      border-radius: 0.25rem;

body {
  height: 100%;

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #00efce;
  color: #4d003a;
  font-family: sans-serif;

body > * {
  max-width: 30rem;

h1 {
  text-align: center;