cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="z-1">Level One</div>
<div class="z-2">Level Two</div>
<div class="z-3">Level Three</div>
<div class="z-4">Level Four</div>
<div class="z-5">Level Five</div>
<button class="z-2 z-h">Hover Me!</button>
            
          
!
            
              // Material Shadow Mixin. Ripped from CSS Tricks. This is most of the heavy lifting and I can't take credit.
// Source -> https://css-tricks.com/snippets/sass/material-shadows-mixin/

@function top-shadow($depth) {
  $primary-offset: nth(1.5 3 10 14 19, $depth) * 1px;
  $blur: nth(1.5 3 10 14 19, $depth) * 4px;
  $color: rgba(black, nth(.12 .16 .19 .25 .30, $depth));

  @return 0 $primary-offset $blur $color;
}
@function bottom-shadow($depth) {
  $primary-offset: nth(1.5 3 6 10 15, $depth) * 1px;
  $blur: nth(1 3 3 5 6, $depth) * 4px;
  $color: rgba(black, nth(.24 .23 .23 .22 .22, $depth));

  @return 0 $primary-offset $blur $color;
}
@mixin card($depth) {
  @if $depth < 1 {
    box-shadow: none;
  } @else if $depth > 5 {
    @warn "Invalid $depth `#{$depth}` for mixin `card`.";
  } @else {
    box-shadow: bottom-shadow($depth), top-shadow($depth);
    transition: all 0.3s cubic-bezier(.25,.8,.25,1);  
  }
}

// My Contribution: I added a @for so I don't have to keep writing the same code. This gives you a z-1 through z-5 class output and a z-h class for hoverables.

@for $i from 1 through 5 {
  .z-#{$i} {
    @include card($i);
  }
  .z-h:hover {
    @include card(5);
  }
}

// Just some basic styling.
div {
  height: 125px;
  width:125px;
  float: left;
  margin: 1em;
  padding: 25px;
}
button {
  margin: 1em;
  background: orange;
  border: 1px orange solid;
  font-size: 2em;
  color: white;
  padding: 15px 30px;
  cursor: pointer;
  border-radius: 5px;
}
            
          
!
999px
Loading ..................

Console