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.


    em CSS-only
    | slide-in animation using 
    code margin-top
    |  (inefficient)
  p Box-shadow is used to highlight the collapsed area.
  p Lorem, ipsum dolor sit amet consectetur adipisicing elit. Modi unde, ex rem voluptates autem aliquid veniam quis temporibus repudiandae illo, nostrum, pariatur quae! At animi modi dignissimos corrupti placeat voluptatum!
  p Facilis ducimus iure officia quos possimus quaerat iusto, quas, laboriosam sapiente autem ab assumenda eligendi voluptatum nisi eius cumque, tempore reprehenderit optio placeat praesentium non sint repellendus consequuntur? Nihil, soluta.



                // Hiding logic

.content {
  // Hiding overflow is necessary for the slide-in effect.
  overflow: hidden; // Spoils position:sticky on descendant elements if there is any.
  overflow: clip; // New to Firefox 81, Chrome 90.

  > *:first-child {
	  transition: margin-top 500ms ease-out;

    details:not([open]) + & {
      margin-top: -20em;

// Styling

details {
  background-color: wheat;
  border: 2px solid darkgoldenrod;
  border-radius: .2em;

.content {
  display: flow-root; // Keep margin within borders
  background-color: lightgoldenrodyellow;
  box-shadow: inset 0 0 0 2px goldenrod; // Border
  border-radius: .2em;

details {
  width: fit-content;
  margin: 0 auto;

summary {
  padding: 0.2em 0.5em;

p {
  margin: 0.6em;

summary em {
  display: inline-block;
  padding: .1em 1em;
  margin-right: 0.5em;
  background-color: goldenrod;
  color: green;
  border-radius: 1em;

body {
  margin: 2em 4em;