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.


                <h1><img src="" alt="Westworld logo" /></h1>
<details id="det-container"><summary>Mainframe</summary>
  <a href="#">Park</a>
  <a href="#">Hosts</a>
  <a href="#">Storylines</a>
  <a href="#">Recalls</a>


                $bgColor: #131e32;
* {
  box-sizing: border-box;
body { margin: 0; }
h1 { 
  margin-top: 0;
  background: #000;
h1 img {
  margin: 10px;
  width: 100px;
@font-face {
  font-family: Brandon Grotesque Medium;
  src: url("");
details {
   font-family: Brandon Grotesque Medium;
  background: $bgColor;
  color: #fff;
  font-size: 1.3rem;
  width: 20rem;
  margin: 0 auto;
  display: block;

details summary {
    padding: .5rem;
    display: block;
details a { 
  display: block;
  color: currentColor;
  text-decoration: none;
  transition: .3s;
  opacity: 0;
  padding: .5rem 0 .3rem 1rem;
  &:hover {
    background: lighten($bgColor, 10%);
details a.visible {
  opacity: 1;

// polyfill info summary::before { 
  content: "►";
  padding-right: 5px;
  font-size: 1.2em;
  transition: .6s linear;
  display: inline-block;
}[open] summary::before { 
  transform: rotate(90deg); 
} a {
  display: none;
details[open].no-det a { 
  display: block;


                var target = document.querySelector('#det-container'),
links = target.getElementsByTagName("a"), 
i = 1;

var observer = new MutationObserver(function(mutations) {
  if (target.hasAttribute("open")) {, function(link) { 
      }, 400*i)

var config = { attributes: true, childList: false, characterData: false }

observer.observe(target, config);

// quick polyfill for MS Edge

function supports_details() {
  if (!('open' in document.createElement('details'))) {
    return "no-details"; }

function switchOpen() {
  if (details.getAttribute('open')) {
  } else {
    details.setAttribute('open', 'open');
if (supports_details() == "no-details" ) {
  var details = document.getElementById("det-container");
  var summary = details.firstElementChild;
  summary.addEventListener("click", switchOpen, false);