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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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="masthead">
  <h1>These arrows are pretty rad!</h1></div>

<div class="demo a"></div>
<div class="demo b"></div>
<div class="demo c"></div>
<div class="demo d"></div>
            
          
!
            
              @import "compass/css3";

@mixin arrow-lazy($direction: top, $size: 10px, $color: #ccc, $center: 50%, $margin: -1px, $pseudo: before){
    position: relative;
    border-color: $color;

    &:#{$pseudo} {
        position: absolute;
        content: "";
        width: 0;
        height: 0;
        border-color: $color;

        @if $direction == "right" {
            top: $center;
            left: 100%;
            margin-left: $margin;
            margin-top: $size * -1;
            border-top: $size solid transparent;
            border-bottom: $size solid transparent;
            border-left: $size solid $color;
            border-left-color: inherit;
        } @else if $direction == "down" {
            top: 100%;
            left: $center;
            margin-top: $margin;
            margin-left: $size * -1;
            border-left: $size solid transparent;
            border-right: $size solid transparent;
            border-top: $size solid $color;
            border-top-color: inherit;
        } @else if $direction == "left" {
            top: $center;
            right: 100%;
            margin-right: $margin;
            margin-top: $size * -1;
            border-top: $size solid transparent;
            border-bottom: $size solid transparent; 
            border-right:$size solid $color;
            border-right-color: inherit;
        } @else {
            bottom: 100%;
            left: $center;
            margin-bottom: $margin;
            margin-left: $size * -1;
            border-left: $size solid transparent;
            border-right: $size solid transparent;
            border-bottom: $size solid $color;
            border-bottom-color: inherit;
        }
    }
}

.demo {
  margin: 20px auto;
  width: 200px;
  height: 50px;
}

.a {
  background: #277ca3;
  transition: all .2s ease-in-out;
  @include arrow-lazy($color: #277ca3);
  
  &:hover {
      background: #3089b0;
      border-color: #3089b0;
    }
}
.b {
  background: #666;
  @include arrow-lazy(down, $color: #666, $margin: 5px);
}
.c {
  background: #39322f;
  @include arrow-lazy(left, 6px, #39322f, 70%);
}
.d {
  background: #b35d3c;
  @include arrow-lazy(right, 25px, #b35d3c, $margin: 0);
}



html {
  background: #faf9ea;
  text-align: center;
}
.masthead {
  background: #b35d3c;
  border-bottom: 1px solid #673521;
}
h1 {
  display: inline-block;
  padding: 15px 20px;
  margin: 30px 0;
  background: #f5f7f7;
  @include arrow-lazy(down, 15px, #f5f7f7);
  font-family: Helvetica, Arial, sans-serif;
  font-weight: normal;
  border-radius: 5px;
}
            
          
!
999px
Loading ..................

Console