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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 class="page">
  <main class="site-main">
    <button type="button" data-toggle="drawer">Toggle</button>

<div class="drawer" id="drawer">
  <header class="drawer__header">
    <div class="close" data-toggle="drawer">x</div>
  <div class="drawer__content">
    <p>Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>


                // vars
$slideout-width: calc(100% - 100px);

// ============================= /
// Drawer.
// ============================= /

#drawer {
  background: snow;
  font-size: 1.5em;
  position: absolute;
  top: 50px;
  bottom: 50px;
  left: -100%;
  width: $slideout-width;
  @extend .box-shadow;
  .drawer__header, .drawer__content { padding: 25px 50px; }
  .drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    h2 { margin: 0; }
    .close {
      @extend .btn;
      display: inline;
      line-height: 1em;
  &.on {
    animation: slideIn .5s ease-in-out both;
  &.off {
    animation: slideOut .5s ease-in-out both;

// ============================= /
// Keyframes.
// ============================= /

@keyframes slideIn {
  0%   { left: -100%; }
  100% { left: 0; }
@keyframes slideOut {
  0%   { left: 0; }
  100% { left: -100%; }

// ============================= /
// Cosmetic.
// ============================= /

.site-main {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  height: calc(100vh - 200px);
  margin: 0;
  text-align: center;


                var togglePanel = function () {
  var e = $('#drawer');
  if ( e.hasClass("off" )) {
  } else if ( e.hasClass("on") ) {
  } else {

var shows = $('[data-toggle="drawer"]');

shows.on('click', function() {