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


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.


Fiddling with the <dialog> element...

* Usability: Element should be required to have a browser-provided Close button
  (in this example, none is provided by content).
  * Might be nice to define it as an attribute of the element, since it IS...
    Even if it's just a boolean attribute, then CSS controlling its visual.
* Firefox:
  * <dialog> element is hidden behind about:config flag
  * FIXED - Doesn't accept [Esc] from the keyboard to close the <dialog>.
  * FIXED - Doesn't acknowledge the ::backdrop pseudo-element
    so it won't recognize clicks that aren't directly on the <dialog> box.
* Chrome/Edge: cursor property on ::backdrop pseudo overrides the element
  even when element cursor is specified.


<dialog id="dialog">
Modal: click backdrop to close.<br>
Any click sends data to Console.


                dialog {
  cursor: default;
  pointer-events: none;
dialog::backdrop {
  background-color: rgba(100,100,100,0.8);
  cursor: pointer;
  pointer-events: all;


    ((event) => {
      let rect =;
ClientX: ${event.clientX}
rect.left: ${rect.left}
rect.right: ${rect.right}

ClientY: ${event.clientY} ${rect.left}
rect.bottom: ${rect.bottom}
    	if (rect.left > event.clientX ||
          rect.right < event.clientX ||
 > event.clientY ||
          rect.bottom < event.clientY
      ) {