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

              
                <header role="banner">
  <h1>CSS Filter: Popup with Blurred Background</h1>
  <h2>Support: Webkit, Firefox, Android 4.4+, iOS 6.0+, No IE</h2>
  <p>(Experimenting with Sass &amp; Compass color functions to create page color scheme.)</p>
</header>

<nav>
  <ul>
    <li>Products</li>
    <li>About</li>
    <li>Contact</li>
    <li>Home</li>
  </ul>
</nav>

<main class="main-body">
  <p>Link to popup: <a href="popover.html">Open Popup</a></p>
  
  <p>
    <span class="circle saturated-beige "></span>
    <span class="circle saturated-complement"></span>
    <span class="circle saturated-invert"></span>
  </p>
  
  <p>Lorem ipsum dolor sit amet, vim denique neglegentur at, ex omnis forensibus nec, sit omnesque omittantur no. Vel error noster putant ea. Nam no audire epicuri, at congue consul est, adhuc scriptorem ne sea. Ei usu adhuc minimum tacimates. Usu ei viris decore persius, eos an placerat menandri tractatos, ne quando periculis usu. Soluta nusquam sit eu, fabellas nominati platonem duo ex.</p>

	<p>Suas semper liberavisse sed in. Duo error numquam cu, quo idque oblique debitis ne, meis electram dissentiet pro no. Vel an solum eligendi, ius te appetere legendos iudicabit. Ex eos veritus facilis persecuti, at eros illum dicunt mea. Ut ludus alienum est.
  </p>
</main>

<div class="greyscreen">
  <div class="popover">
    <h2>CSS filter: popup with  blurred background</h2>
    <p>Click anywhere inside the popup to close it. To re-open, click the "Open Popup" link.</p>
  </div>
</div>

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
    <filter id="blur">
     	<feGaussianBlur stdDeviation="3"/>
    </filter>
  
    <filter id="drop-shadow">
	    <feGaussianBlur in="SourceAlpha" stdDeviation="2"/>
	    <feOffset dx="5" dy="5" result="offsetblur"/>
	    <feFlood flood-color="#000000"/>
	    <feComposite in2="offsetblur" operator="in"/>
	    <feMerge>
		    <feMergeNode/>
		    <feMergeNode in="SourceGraphic"/>
	    </feMerge>
	</filter>
</defs>
</svg>
              
            
!

CSS

              
                // New test code:
.greyscreen-open {
  > :not(.greyscreen) {
  	-webkit-filter: blur(3px);
    filter: url(#blur); // FF
	}
  
  .greyscreen {display: block;}
}

.greyscreen {
  display: none;
  background: rgba(0, 0, 0, .3);
  position: fixed;
  z-index: 500;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 0 1.5em;
  overflow: auto;
}

.popover {
  background: #fff;
  border-radius: 5px;
  border: 2px solid;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .75);
  margin: 1.5em auto;
  padding: 1em;
  width: 32em;
  
  :first-child {margin-top: 0;}
  :last-child {margin-bottom: 0;}
}


// Color functions etc. layout:
* {box-sizing: border-box;}

// beige: #c4af89, #turquoise: #52a8ba
$base: #c4af89;
$saturated-base: saturate($base, 30%);
$light-base: lighten($base, 25%);
$base-black: darken($base, 50%);
$complement: complement($base);
$complement-black: darken($complement, 50%);
$saturated-complement: saturate($complement, 30%);
$invert: invert($base);
$saturated-invert: saturate($invert, 30%);

body {
  background: $light-base;
  color: $base-black;
}

[role="banner"] {
  background: $base;
  padding: 1em;
  
  h1 {margin: 0;}
}

nav {
  border-top: 10px solid $invert;
  background: $complement;
  color: $complement-black;
  
  ul {
    list-stye: none;
    margin: 0;
    padding: 0;
    display: table;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    
    li {
      display: table-cell;
      text-align: center;
      padding: 0.5em 1em;
    }
  }
}

a {color: $saturated-complement;}

.circle {
  border-radius: 50%;
  display: inline-block;
  height: 4em;
  width: 4em;
  margin: .5em;
}

.saturated-beige {
  background: $saturated-base;
}

.saturated-complement {
  background: $saturated-complement;
}

.saturated-invert {background: $saturated-invert;}

.main-body {padding: 0 1em;}


// extra -----------------------
h1 {margin: 0;}
h1 + h2 {margin: .1em 0 0;}
header p {margin: .5em 0 0;}
body {margin: 0;}

              
            
!

JS

              
                $(document).ready(function() {
  // display popover on initial page load:
  $('body').addClass('greyscreen-open');
  
  $('a[href*="popover"]').click(function() {
    $('body').addClass('greyscreen-open');
    return false;
  });
  
  $('.popover').click(function() {
    $('body').removeClass('greyscreen-open');
  });
});
              
            
!
999px

Console