Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <main>
  <details>
    <summary>Reveal/hide lorem text</summary>
    <div class="details-content">
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Tincidunt ornare massa eget egestas purus. Turpis egestas sed tempus urna et pharetra pharetra massa. Feugiat vivamus at augue eget arcu dictum varius. Turpis egestas pretium aenean pharetra magna ac placerat. Elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at. Massa ultricies mi quis hendrerit dolor magna eget est. Sit amet tellus cras adipiscing enim eu. Lorem dolor sed viverra ipsum nunc aliquet bibendum. Viverra orci sagittis eu volutpat odio facilisis mauris sit. Ut placerat orci nulla pellentesque dignissim. Volutpat sed cras ornare arcu dui vivamus arcu felis. Vitae proin sagittis nisl rhoncus mattis rhoncus urna neque viverra. Ullamcorper a lacus vestibulum sed arcu non odio. Morbi non arcu risus quis varius quam quisque. Vitae justo eget magna fermentum iaculis eu non. Malesuada fames ac turpis egestas sed. Arcu odio ut sem nulla pharetra diam sit.</p>

      <p>Ipsum dolor sit amet consectetur adipiscing elit pellentesque. Vel pretium lectus quam id leo in vitae turpis massa. In est ante in nibh mauris cursus. Aliquet nec ullamcorper sit amet risus. Ac odio tempor orci dapibus ultrices in iaculis nunc. Lorem dolor sed viverra ipsum. Sapien eget mi proin sed libero enim. Faucibus a pellentesque sit amet. Viverra aliquet eget sit amet tellus cras adipiscing enim eu. Maecenas sed enim ut sem viverra aliquet. In arcu cursus euismod quis. Nibh nisl condimentum id venenatis a condimentum vitae. Ac feugiat sed lectus vestibulum mattis ullamcorper velit.</p>
    </div>
</details>
</main>
              
            
!

CSS

              
                main {
  width: 100%;
  max-width: 48rem;
  margin: auto;
  padding: 1rem;
}

details {
  overflow: hidden;
  border: .125rem solid #00a39b;
  border-radius: 1rem;
  
  &,
  summary,
  .details-content{
    position: relative;
  }

  summary {
    z-index: 2;
    margin: 0;
    color: #ffffff;
    background: #00a39b;
  }
  
  summary,
  .details-content {
    padding: 1rem;
  }
  
  .details-content {
    z-index: 1;
    margin: 0;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path .25s ease-out .125s;
  }
  
  &[open] {
    summary {
      top: 50%;
      animation: replaceSummary .25s ease-out 0s 1 both;
    }
    
    .details-content {
      clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
  }
}

@keyframes replaceSummary {
  0% {
    top: 50%;
  }
  100% {
    top: 0;
  }
}

// Resets…
* { box-sizing: border-box; }
p { margin: 0; }
p + p { margin-top: 1em; }

html,
body {
  height: 100%;
}

body {
  display: flex;
  margin: 0;
  
  color: #161616;
  background-color: #e6e6e6;
}
              
            
!

JS

              
                
              
            
!
999px

Console