Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

HTML

              
                .wrapper
  .container
    article 
      h2 Aenean posuere
      p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra quis enim a fermentum. Etiam sed interdum tellus, ac gravida ante. Etiam eu mi at erat molestie mattis eu a elit. Cras ac varius mi. Maecenas tempus non urna vitae posuere. Aenean posuere, mi non ullamcorper sollicitudin, sapien elit molestie risus, a maximus felis lectus vel sapien. Vestibulum convallis dolor in magna malesuada ultrices. Sed et ipsum est. Sed laoreet tellus sit amet auctor tempus. Proin et cursus nulla, a vulputate ante. Donec pellentesque rhoncus elementum. Nullam vitae diam elementum, tincidunt elit non, mattis nibh.
      button.toggleModal modal
      
    article 
      h2 Vestibulum convallis
      p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra quis enim a fermentum. Etiam sed interdum tellus, ac gravida ante. Etiam eu mi at erat molestie mattis eu a elit. Cras ac varius mi. Maecenas tempus non urna vitae posuere. Aenean posuere, mi non ullamcorper sollicitudin, sapien elit molestie risus, a maximus felis lectus vel sapien. Vestibulum convallis dolor in magna malesuada ultrices. Sed et ipsum est. Sed laoreet tellus sit amet auctor tempus. Proin et cursus nulla, a vulputate ante. Donec pellentesque rhoncus elementum. Nullam vitae diam elementum, tincidunt elit non, mattis nibh.
      button.toggleModal modal
 
.modal.is-active
   .modal__header
     .inner
       h2 Donec pellentesque
   .modal__content
      .inner
        p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras pharetra quis enim a fermentum. Etiam sed interdum tellus, ac gravida ante.
   .modal__footer
     .inner
        button.toggleModal close
 
svg(version="1.1", xmlns="http://www.w3.org/2000/svg")
   filter#blur
      feGaussianBlur(stdDeviation="3")

              
            
!

CSS

              
                
@import url(https://fonts.googleapis.com/css?family=Open+Sans);

/* 
Variables
*/
$color-white: #fff;
$color-dark: #444;
$color-gray: #333;
$color-bg: #eee;
$color-active: #1abc9c;
$gutter: 20px;
$small: "only screen and (min-width: 650px)";
$svgBlur: url("#blur");

/*
Animations
*/
@keyframes slide {
  from {
    top: 0;
  }
  to {
    top: 50%;
  }
}

/*
Reset
*/
*:focus {
    outline: 0; /* removes blue border on focus */
}
button {
	background: none;
 	background-clip: padding-box; /* prevents bg color from leaking outside the border */
	display: inline-block;
	border: 0;
	user-select: none;
	-webkit-touch-callout: none;
	-webkit-appearance: button; /* for input */
    -webkit-user-select: none; /* for button */
       -moz-user-select: none;
        -ms-user-select: none;
}

/* apply a natural box layout model to all elements, but allowing components to change */
html {
  box-sizing: border-box;
  position: relative;
  min-height: 100%;
  font-family: 'Open Sans', sans-serif;
}

body {
  heigth: 100%;
  background: #eee;
  overflow: none;
  
  &.is-blurred {
    overflow: hidden;
  
    .wrapper {
      filter: $svgBlur; /* SVG filters for browser support. */ 
      filter: blur(3px); /* works in chrome */
      -webkit-transition : -webkit-filter 500ms linear;
      pointer-events: none;
      user-select: none;
    }
  }
}

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

/*
Typography
*/
h2 {
  color: #444;
  font-size: 30px;
  line-height: 32px;
}
p {
  color: #555;
  font-size: 16px;
  line-height: 24px;
}


.container {
    position: relative;
    margin:0 auto;
    max-width: 960px;
    box-sizing: border-box;
    padding-top: 40px;
}

article {
  background: #fff;
  padding: 20px;
  margin-bottom: 40px;
  border-radius: 5px;
  
  p,
  h2 {  
    padding-bottom: $gutter;
  }
  h2 {
    padding-top: 10px;
  }
}

button {
  border: 2px solid $color-active;
  color: $color-active;
  border-radius: 4px;
  font-size: 20px;
  padding: 10px 40px;
  cursor: pointer;
  
  &:hover {
    border-color: darken($color-active, 10%);
    color: darken($color-active, 10%);
  }
}
.modal {
  display: none;
	position: fixed;
	top: 50%;
	width: 100%;
	height: auto;
	margin-top: -150px;
  background-color: $color-white;
	border-radius: 3px;
	z-index: 999;
  box-shadow: 0px 1px 3px 0px darken($color-bg, 10%);

	@media #{$small} {
		left: 50%;
		margin-left: -260px;
		max-width: 520px;
	}
  
  &.is-active {
    display: block;
    animation: 1s linear slide; // a small animation for the modal
  }
  .inner {
    position: relative;
    padding: 20px;
  }
}
.modal__header {
	border-bottom: 1px solid darken($color-bg, 5%);
}
.modal__footer {
  text-align: center;
  
  button {
    display: inline-block;
  }
}
              
            
!

JS

              
                $('body').addClass('is-blurred');

$('.toggleModal').on('click', function (event) {
  event.preventDefault();
  
  $('.modal').toggleClass('is-active');
  $('body').toggleClass('is-blurred');
});

// some improvements on the modal suggested by @iammarkoradak
              
            
!
999px

Console