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.


                <div id="page-wrapper">
  <h1>Native &lt;dialog&gt; Element Demo</h1>
    This will only work in Chrome Canary. Be sure to enable the <code>Enable experimental Web Platform features</code> flag.

  <button id="launchDialog">Launch Dialog</button>
  <button id="launchModal">Launch Modal</button>
  <button id="launchStyledModal">Launch Styled Modal</button>

    A polyfill is available <a href="" target="_blank">here</a>.

<dialog id="dialog">
  <p>Hi, I'm a dialog!</p>
  <button class="close">Okay</button>

<dialog id="modal">
  <p>Hi, I'm a modal!</p>
  <button class="close">Okay</button>

<dialog id="styledModal">
  <p>Hi, I'm a styled modal!</p>
  <button class="close">Okay</button>


                html {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 100%;

h1 {
  margin-top: 0;

button {
  display: inline-block;
  border-radius: 3px;
  border: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.8em;
  background: #69c773;
  border-bottom: 1px solid #498b50;
  color: white;
  -webkit-font-smoothing: antialiased;
  font-weight: bold;
  margin: 0 0.25rem;
  text-align: center;

button:hover, button:focus {
  opacity: 0.75;
  cursor: pointer;

button:active {
  opacity: 1;
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.1) inset;

#styledModal {
  background: #FFF;
  width: 300px;
  text-align: center;
  padding: 1.5em;
  margin: 1em auto;
  border: 0;
  border-top: 5px solid #69c773;
  box-shadow: 0 2px 10px rgba(0,0,0,0.8);

#styledModal::backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);



                window.onload = function () {
  // Get the buttons.
  var dialogBtn = document.getElementById('launchDialog');
  var modalBtn = document.getElementById('launchModal');
  var styledModalBtn = document.getElementById('launchStyledModal');
  var closeBtns = document.querySelectorAll('.close');
  // Get the dialogs.
  var dialog = document.getElementById('dialog');
  var modal = document.getElementById('modal');
  var styledModal = document.getElementById('styledModal');
  // Setup Event Listeners
  dialogBtn.addEventListener('click', function(e) {
  modalBtn.addEventListener('click', function(e) {
  styledModalBtn.addEventListener('click', function(e) {
  for (var i = 0; i < closeBtns.length; i++) {
    closeBtns[i].addEventListener('click', function(e) {