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.


                <h2>Animation with CSS Variables</h2>
    <div class="controls">
      <input type="range" id="x" min="0" max="360" value="10">
      <input type="range" id="y" min="0" max="360" value="10">
      <input type="range" id="z" min="0" max="360" value="10">


    <div class="display">
      <img class="photo" src="">

    <p class="love">Made by <a href="">@wesbos</a> 🔥</p>

    <p class="love">Chrome 49+, Firefox 31+</p>


                   :root {
     --x: 10deg;
     --y: 10deg;
     --z: 10deg;
     --base: #1497AD;
   .photo {
     transform: rotateX(var(--x)) rotateY(var(--y)) rotateZ(var(--z));
     transition: all 0.5s;
     border: 20px solid white;
     box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        misc styles, nothing to do with CSS variables
   body {
     text-align: center;
     background: #ffc600;
     color: white;
     font-family: 'helvetica neue', sans-serif;
     font-weight: 100;
     font-size: 50px;
   .display {
     perspective: 800px;
   .controls {
     margin-bottom: 50px;
     position: relative;
     z-index: 2;
   a {
     color: var(--base);
     text-decoration: none;


                      // get the inputs
      const inputs = []'.controls input'));

      // listen for changes
      inputs.forEach(input => input.addEventListener('change', handleUpdate));
      inputs.forEach(input => input.addEventListener('mousemove', handleUpdate));

      function handleUpdate(e) {
        // append 'px' to the end of spacing and blur variables
        const suffix = ( === 'base' ? '' : 'px');
        var property = `--${}`;
        // remove the last one so we don't pollute the element with inline styles;
        // update the element. Note: We are doing this on <html>, but varaibles can be scoped to ANY element, this.value + 'deg');