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.


                <div class="wrapper">
    <h2>The best modal ever made.</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure architecto facere et illo rem labore aliquam quia molestias ut dolorum quidem enim dolor provident odio laborum dicta obcaecati non asperiores!</p>    
    <button class="button-border toggleModal">
      <span class="icon">&#61723</span> trigger iModal</button>
  <div class="modal">
      <button class="close toggleModal">Close</button>
      <p>Lorem ipsum dolor sit amet, consectetur amis at adipisicing elit. Maiores quaerat est officia aut nam amet ipsum natus corporis adipisci cupiditate voluptas unde totam quae vel error neque odio id etas lasf reiciendis.</p>
    <button class="button-border button-success">
      <span class="icon">&#61853</span> Download</button>
    <button class="button-border button-error pull-right">
      <span class="icon">&#61756 </span>Lock</button>


                @import "compass/css3";

@import "compass/css3/shared";

@font-face {
  font-family: 'ios7-icon';
    url('//') format('woff'),
    url('//') format('ttf');
  font-weight: normal;
  font-style: normal;

$blue : #007aff;
$green : #4dd865;
$red : #ff3b30;
$white : #ffffff;
$black : #000000;

*, *:before, *:after {
  -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;

body {
  padding: 50px;
  font-family: 'Helvetica Neue' !important;
  font-weight: 300;

.wrapper {
    max-width: 500px;
    margin: 0 auto;

h1 {
  font-weight: 100;
  font-size: 45px;
  color: $blue;

h2 {
  font-weight: 500;
  font-size: 21px;
  margin-bottom: 15px;

section {
  margin-top: 30px;
  p {
    line-height: 1.4;
    margin-bottom: 20px;

button {
  @include experimental('appearance', 
    webkit, moz, o, ms, not khtml);
  @include border-radius(5px);
  border: none;
  font: inherit;
  cursor: pointer;
  margin: 0;
  padding: 0;
  background: $white;
  color: $blue;
  font-weight: 300;
  font-size: 16px;
  @include border-radius(0px);
  &:hover {
    text-decoration: underline;

/*  &:last-child {
    border-color: red;
    margin-bottom: 0;
  &.button-border {
    @include border-radius(5px);
    padding: 10px 12px 8px 12px;
    border: 1px solid $blue; 
    &:hover {
      background: $blue;
      color: $white;
      text-decoration: none;

  &.button-success {
    color: $green;
    border-color: $green;
    &:hover {
      background: $green;

  &.button-error {
    color: $red;
    border-color: $red;
    &:hover {
      background: $red;

.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 400px;
  height: auto;
  margin-left: -200px;
  margin-top: -150px;
  background-color: $white;
  padding: 25px;
  border-radius: 5px;
  z-index: 10;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  &.active {
    display: block;
  header {
    position: relative;

  h2 {
    text-align: center;

  .close {
    position: absolute;
    top: 3px;
    right: 0;
    margin: 0;


.pull-right {
  float: right;  

.icon {
  display: inline-block;
  font-size: inherit;
  font-family: 'ios7-icon';
  margin-right: 5px;
  color: inherit;
  -webkit-text-rendering: geometricPrecision;
  -moz-text-rendering: geometricPrecision;
  -ms-text-rendering: geometricPrecision;
  -o-text-rendering: geometricPrecision;
  text-rendering: geometricPrecision;







$('.toggleModal').on('click', function (e) {