Pen Settings

HTML

CSS

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

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

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.

HTML

              
                #page-main.fullscreen
  .header
    h2 Page 1 (main)
  .content
    table.table.table-align-middle
      tbody
          tr
              td Item title
              td.table-actions-column
                  a.btn.btn-default(href="#", class="to-sub-page") &rarr;
          tr
              td Item title
              td.table-actions-column
                  a.btn.btn-default(href="#", class="to-sub-page") &rarr;
          tr
              td Item title
              td.table-actions-column
                  a.btn.btn-default(href="#", class="to-sub-page") &rarr;
    .btn-toolbar
      a.btn.btn-default(href="#", id="to-modal") Show modal
      a.btn.btn-default(href="#", id="toggle-toolbar") Toggle toolbar

#page-sub.fullscreen
  .header
    .btn-toolbar
      a.btn.btn-default(href="#", id="to-main-page") &larr;
     h2 Page 2 (sub)
  .content
    p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odit sapiente tenetur illo, quas blanditiis perferendis veniam sunt, quaerat nisi officia id odio tempore architecto, reprehenderit sit. Similique, ratione corporis aliquid.
    table.table.table-align-middle
      tbody
          tr
              td Item
              td.table-actions-column
                  a.btn.btn-default(href="#", class="to-sub-sub-page") &rarr;
          tr
              td Item
              td.table-actions-column
                  a.btn.btn-default(href="#", class="to-sub-sub-page") &rarr;
          tr
              td Item
              td.table-actions-column
                  a.btn.btn-default(href="#", class="to-sub-sub-page") &rarr;

#page-sub-sub.fullscreen
  .header
    .btn-toolbar
      a.btn.btn-default(href="#", id="to-sub-page") &larr;
    h2 Page 3 (sub sub)
  .content
    p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odit sapiente tenetur illo, quas blanditiis perferendis veniam sunt, quaerat nisi officia id odio tempore architecto, reprehenderit sit. Similique, ratione corporis aliquid.
    p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odit sapiente tenetur illo, quas blanditiis perferendis veniam sunt, quaerat nisi officia id odio tempore architecto, reprehenderit sit. Similique, ratione corporis aliquid.

#toolbar.is-inverse.is-inverse-bg-dark
  .btn-toolbar.pull-left
    .btn-group.pull-left
      a.btn.btn-ghost-inverse(href="#")
        i.glyphicon.glyphicon-star
      a.btn.btn-ghost-inverse(href="#")
        i.glyphicon.glyphicon-heart
    .btn-group.pull-left
      a.btn.btn-ghost-inverse(href="#") Control 1
      a.btn.btn-ghost-inverse(href="#") Control 2
    .btn-toolbar.pull-left
      a.btn.btn-ghost-inverse(href="#") Control 1
      a.btn.btn-ghost-inverse(href="#") Control 2
   .btn-toolbar.pull-right
      a.btn.btn-ghost-inverse(href="#", id="close-toolbar") &times;

#modal.fullscreen.is-inverse.is-inverse-bg
  .header
    .btn-toolbar
      a.btn.btn-ghost-inverse(href="#", id="close-modal") &times;
    h2 Modal
  .content
    p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore vero sint magnam, nemo earum, tempore fuga delectus officia voluptatum quidem. Quaerat autem pariatur expedita, consequuntur laborum recusandae ducimus blanditiis nobis!
    table.table
      thead
          tr
              th Name(s)
              th Scope
              th Description
      tbody
          tr
              td Land plants, also known as Embryophyta or Metaphyta.
              td Plantae sensu strictissimo
              td
                  | This group includes the liverworts, hornworts, mosses, and vascular plants, as well...
          tr
              td Green plants - also known as Viridiplantae, Viridiphyta or Chlorobionta
              td Plantae sensu stricto
              td
                  | This group includes the land plants plus various groups of green algae, including stoneworts.
          tr
              td Archaeplastida, Plastida or Primoplantae
              td Plantae sensu lato
              td
                  | This group comprises the green plants above plus Rhodophyta (red algae) and Glaucophyta...

              
            
!

CSS

              
                *, *:before, *:after {
  box-sizing: border-box;
}

body,
html {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
}

.fullscreen {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

#page-main {
  background: #EEE;
}

#page-sub {
  background: #EEE;
}

#page-sub-sub {
  background: #EEE;
}

#modal {
  top: 100vh;
}

#toolbar {
  background: #333;
  width: 100vw;
  height: auto;
  padding: 20px;
  position: fixed;
  bottom: -100%;
}

.is-inverse-bg {
  background: #666;
}

.is-inverse {
  color: #DDD;
  h1, h2, h3 {
    color: #FFF;
  }
  table.table th {
    color: #FFF;
  }
}

// Table styles

.table.table-align-middle tbody {
  td, th {
    vertical-align: middle;
    // Some extra specifity to override Bootstrap
  }
}

// Table column styles

.table-actions-column {
  text-align: right;
  .btn {
    float: right;
  }
}

// Button styles

.btn.btn-ghost-inverse {
  color: #FFF;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  &:hover,
  &:active,
  &:focus {
    background: rgba(255, 255, 255, 0.33);
    border-color: rgba(255, 255, 255, 1)
  }
}

.btn.btn-ghost {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.3);
  &:hover,
  &:active,
  &:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 0, 0, 1)
  }
}

.header {
  height: 50px;
  background: #FFF;
  box-shadow: 0 0 3px rgba(0,0,0,0.25);
  .is-inverse & {
    background: #000;
  }
}

// Header positioning

.header .btn-toolbar {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 10;
}

.header h2 {
  font-size: 20px;
  text-align: center;
  line-height: 50px;
  margin: 0;
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
}

.content {
  padding: 15px;
}
              
            
!

JS

              
                // Hide initial elements
// @todo be able to open the pages in this "state"
$('#page-sub, #page-sub-sub, #toolbar').hide();

// Show modal
$('#page-main #to-modal.btn').click(function(e) {
  e.preventDefault();

  $("#modal").velocity({
    top: "0",
  }, {
    duration: 300,
    easing: "ease-in"
  });

});

// Toggle the toolbar
$('#page-main #toggle-toolbar.btn').click(function(e) {
  e.preventDefault();
  $('#toolbar').show();
  if (!$("#toolbar").hasClass('open')) {
    $("#toolbar")
    .addClass('open')
    .velocity({
      bottom: "0",
    }, {
      duration: 300,
      easing: "ease-in-out"
    });
  } else {
   $("#toolbar")
    .removeClass('open')
    .velocity({
      bottom: "-100%",
    }, {
      duration: 300,
      easing: "ease-in-out"
    });
  }

});

// Go from sub page to main page
$('#page-sub #to-main-page').click(function(e) {
  e.preventDefault();

  $("#page-sub").velocity({
    right: "-100vw",
  }, {
    duration: 300,
    easing: "ease-in-out"
  });

});

// Go from main page to sub page
$('#page-main .to-sub-page.btn').click(function(e) {
  e.preventDefault();

  $("#page-sub").css('left', "auto").css('right', "-100vw").show().velocity({
    right: "0",
  }, {
    duration: 300,
    easing: "ease-in-out"
  });

});

// Go from main page to sub page
$('#to-sub-page.btn').click(function(e) {
  e.preventDefault();
    $("#page-sub-sub").css('left', "auto").css('right', "0").show().velocity({
    right: "-100%",
  }, {
    duration: 300,
    easing: "ease-in-out"
  });
});

// Go from sub page to sub sub page
$('#page-sub .to-sub-sub-page.btn').click(function(e) {
  e.preventDefault();

  $("#page-sub-sub").css('left', "auto").css('right', "-100vw").show().velocity({
    right: "0",
  }, {
    duration: 300,
    easing: "ease-in-out"
  });

});

// Close the toolbar
$('#close-toolbar.btn').click(function(e) {
  e.preventDefault();

  $("#toolbar").velocity({
    bottom: "-100%",
  }, {
    duration: 300,
    easing: "ease-in-out"
  });
  $("#toolbar").removeClass('open');

});

// Close modal
$('#modal #close-modal').click(function(e) {
  e.preventDefault();

  $("#modal").velocity({
    top: "100vh",
  }, {
    duration: 300,
    easing: "ease-in-out"
  });

});
              
            
!
999px

Console