Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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.


Auto Save

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="root">
  <div class="browser-frame">
    <div class="browser-frame__browser-buttons"></div>
    <figure class="js-figure-lightbox figure figure--screenshot">
      <a href="">
          <!-- Transparent 1px image encoded as base64 data URI -->
        <img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="">
        <p>Screenshot caption</p> 


                // Specify your screenshot size
$img-width: 272px;
$img-height: 340px;

// Specify your screenshot background
$screenshot-background-color: #fff;

// Toggle caption display
$caption-display: initial; // switch to `none` to hide caption
// $caption-display: none; // switch to `initial` to show caption

// Other configuration variables
$body-background: #111;
$browser-frame-background: desaturate(lighten($body-background, 10%), 10%);
$browser-frame-border-radius: 8px;
$browser-frame-border-width: 2px;
$browser-frame-color: #efefef;
$browser-frame-padding: 24px;
$browser-button-1-color: hsl(360, 80%, 60%);
$browser-button-2-color: hsl(60, 80%, 60%);
$browser-button-3-color: hsl(90, 80%, 60%);
$browser-button-size: 12px;
$browser-button-spacing: 24px;
$caption-color: #efefef;
$caption-padding: 6px;

// Resets and body styles

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;

body {
  background-color: $body-background;
  color: #444;
  font: 400 16px/1.5 "Merriweather Sans", "Raleway", "Helvetica Neue", Helvetica, Arial, sans-serif;
  margin: 40px auto;
  padding: 0 10px;

// CSS Browser frame

.browser-frame {
  background-color: $browser-frame-background;
  border: $browser-frame-border-width solid $browser-frame-color;
  border-radius: $browser-frame-border-radius;
  padding-top: ($browser-frame-padding * 2) - $browser-frame-border-width;
  padding-right: ($browser-frame-padding / 2) - $browser-frame-border-width;
  padding-bottom: ($browser-frame-padding / 2) - $browser-frame-border-width;
  padding-left: ($browser-frame-padding / 2) - $browser-frame-border-width;
  position: relative;

.browser-frame__browser-buttons {
  background-color: $browser-button-1-color;
  border-radius: 50%;
  color: #fff;
  position: absolute;
  top: ($browser-frame-padding / 2) + ($browser-button-size / 2);
  width: $browser-button-size;
  height: $browser-button-size;
  &::before {
    background-color: $browser-button-2-color;
    border-radius: 50%;
    color: #fff;
    content: '';
    position: absolute;
    top: 0;
    left: $browser-button-spacing;
    width: $browser-button-size;
    height: $browser-button-size;
  &::after {
    background-color: $browser-button-3-color;
    border-radius: 50%;
    color: #fff;
    content: '';
    position: absolute;
    top: 0;
    left: $browser-button-spacing * 2;
    width: $browser-button-size;
    height: $browser-button-size;

figure a {
  background: $screenshot-background-color;
  display: inline-block;

figure img {
  width: $img-width;
  height: $img-height;

figcaption {
  display: $caption-display;
  color: $caption-color;
  text-align: center;
  p {
    padding-top: $caption-padding;

// Irrelevant demo styles

#root {
  // left: 50%;
  // margin-right: -50%;
  // margin: 0;
  // position: absolute;
  // top: 50%;
  // transform: translate(-50%, -50%);
  align-items: center;
  display: flex;
  justify-content: center;