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.


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.


                <div id="replace"></div>
<div id="add"></div>


                div {
  width: var(--size);
  height: var(--size);
  background: hsl(var(--hue,343), 95%,54%);
  margin: 5vmin;
  --size: 40vmin;

div:nth-of-type(2) {
  --hue: 183

div {

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: hsl(223, 80%, 12%);
*, *::before, *::after {
  box-sizing: border-box;


                //As of 10/9/17, this works in Firefox Nightly only
var defaultElement = document.getElementById('replace');
var add = document.getElementById('add');

const animation1Timing = {
  duration: 2100,
  iterations: Infinity,
  direction: 'alternate'
const animation2Timing = {
  duration: 3100,
  iterations: Infinity,
  direction: 'alternate'
const animation3Timing = {
  duration: 1100,
  iterations: Infinity,
  direction: 'alternate'

const animation1Keyframes = [
  {filter: 'hue-rotate(0deg)'},
  {filter: 'hue-rotate(360deg)'}
const animation2Keyframes = [
  {filter: 'opacity(100%)'},
  {filter: 'opacity(0%)'}
const animation3Keyframes = [
  {filter: 'blur(0px)'},
  {filter: 'blur(10px)'}

//First Div: Default (replace) - only the last animation will show since each animation affects the same property and it overrides the first three animations

//Second Div: Composite (add) - the browser is in charge of maintaining each value in the same property according to the animation's timeline and the order the animations were added
add.animate(animation3Keyframes, animation3Timing);
add.animate(animation1Keyframes, Object.assign({composite: 'add'},animation1Timing));
add.animate(animation2Keyframes, Object.assign({composite: 'add'},animation2Timing));
add.animate(animation3Keyframes, Object.assign({composite: 'add'},animation3Timing));

setTimeout(() => {
  console.log('filter values 550ms into the animations:');
  console.log(`default behavior (replace): ${getComputedStyle(defaultElement).filter}`);
  console.log(`with new composite (add):   ${getComputedStyle(add).filter}`);
}, 550)