css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="dog">
  <div class="collar"></div>
  <div class="neck"></div>
  <div class="tongue"></div>
  <div class="mouth"></div>
  <div class="face"></div>
  <div class="ear--left"></div>
  <div class="ear--right"></div>
  <div class="eye--left"></div>
  <div class="eye--right"></div>
  <div class="nose"></div>
  <div class="freckles--left"></div>
  <div class="freckles--right"></div>
</div>

            
          
!
            
              @import "compass/css3";

/* Puppy created using the Sassy Shape Machine Mixin!

based on this Dribbble: http://dribbble.com/shots/1146826-Pupface */

// Color Call:
$darkbrown: #523026;
$tan: #f4e5be;
$caramel: #cc9b59;
$orange: #f25a2b;
$gold: #e4bb3b;
$skyblue: #7dcdd4;
$pink: #f9b1e0;

// ****** Here's the Mixin!
@mixin shape($shape, $size, $color){
	@if $shape == square {
		width: $size;
		height: $size;
		background-color: $color;
	}
	@if $shape == circle {
		width: $size;
		height: $size;
		background-color: $color;
		border-radius: 50%;
	}
	@if $shape == triangle {
		width: 0;
		height: 0;
		border-left: $size solid transparent;
		border-right: $size solid transparent;
		border-bottom: $size*1.5 solid $color;
	}
	@if $shape == right-triangle {
		width: 0;
		height: 0;
		border-bottom: $size solid $color;
		border-right: $size solid transparent;
	}
	@if $shape == diamond {
		width: 0;
		height: 0;
		border: $size solid transparent;
		border-bottom-color: $color;
		position: relative;
		top: -$size;
	
		&:after {
			content: '';
			position: absolute;
			left: -$size;
			top: $size;
			width: 0;
			height: 0;
			border: $size solid transparent;
			border-top-color: $color;
		}
	}
	@if $shape == pentagon {
		position: relative;
		width: $size;
		border-width: (25/27)*$size (1/3)*$size 0;
		border-style: solid;
		border-color: $color transparent;
		
		&:before {
			content: "";
			position: absolute;
			height: 0;
			width: 0;
			top: (-17/11)*$size;
			left: (-1/3)*$size;
			border-width: 0 (5/6)*$size (35/54)*$size;
			border-style: solid;
			border-color: transparent transparent $color;
		}
	}
	@if $shape == hexagon {
		width: $size*2;
		height: $size*1.1;
		background: $color;
		position: relative;
		&:before {
			content: "";
			position: absolute;
			top: $size/-2;
			left: 0;
			width: 0;
			height: 0;
			border-left: $size solid transparent;
			border-right: $size solid transparent;
			border-bottom: $size/2 solid $color;
		}
		&:after {
			content: "";
			position: absolute;
			bottom: $size/-2;
			left: 0;
			width: 0;
			height: 0;
			border-left: $size solid transparent;
			border-right: $size solid transparent;
			border-top: $size/2 solid $color;
		}
	}
	@if shape == octogon {
		width: $size;
		height: $size;
		background: transparent;
		position: relative;
		text-align: center;
	
		&:before {
			content: "";
			position: absolute;
			top: 0;
			left: 0;
			border-bottom: 29/$size solid $color;
			border-left: 29/$size solid transparent;
			border-right: 29/$size solid transparent;
			width: 42/$size;
			height: 0;
		}
		
		&:after {
			content: "";
			position: absolute;
			bottom: 0;
			left: 0;
			border-top: 29/$size solid $color;
			border-left: 29/$size solid transparent;
			border-right: 29/$size solid transparent;
			width: 42/$size;
			height: 0;
		}
	}
}

// ****** end of the mixin :)

// ****** Here's the styling!

body {
  background: $skyblue;
  margin-top: -80px;
}

div {
  position: absolute;
  &:after {
    position: absolute;
  }
  &:before {
    position: absolute;
  }
}

.collar {
  @include shape(circle, 200px, $orange);
  margin: 210px 200px;
  &:after {
    @include shape(circle, 50px, $gold);
    content: "";
    margin: 100% 40%;
  }
}

.neck {
  @include shape(circle, 180px, $tan);
  margin: 200px 210px;
}

.mouth {
  @include shape(circle, 120px, $caramel);
  margin: 210px 180px;
  &:after {
    @include shape(circle, 120px, $caramel);
    content: "";
    margin: 0 95%;
  }
}

.face {
  background-color: $tan;
  height: 150px;
  margin: 120px 180px;
  width: 235px;
}

%ear {
  @include shape(right-triangle, 100px, $darkbrown);
  border-bottom: 150px solid $darkbrown;
  margin-top: 118px;
  &:after {
    @include shape(circle, 100px, $darkbrown);
    content: "";
    margin: 108px 0;
  }
}

.ear--left {
  @extend %ear;
  @include rotateY(180deg);
  margin-left: 80px;
}

.ear--right {
  @extend %ear;
  margin-left: 413px;
}

%eye {
  margin-top: 180px;
  width: 30px;
  height: 30px;
  border: 15px solid $darkbrown;
  border-radius: 50%;
  &:after {
    content: "";
    width: 60px;
    height: 30px;
    background-color: $tan;
    margin: 50% -50%;
  }
}

.eye--left {
  @extend %eye;
  margin-left: 200px;
}

.eye--right {
  @extend %eye;
  margin-left: 330px;
}

.nose {
  @include shape(triangle, 30px, $darkbrown);
  @include rotate(180deg);
  margin: 230px 267px;
  
}

%freckles {
  @include shape(circle, 15px, $darkbrown);
  margin-top: 285px;
  &:before {
    @include shape(circle, 15px, $darkbrown);
    content: "";
    margin: -20px 15px;
  }
  &:after{
    @include shape(circle, 15px, $darkbrown);
    content: "";
    margin: -20px -15px;
  }
}

.freckles--left {
  @extend %freckles;
  margin-left: 220px;
}

.freckles--right {
  @extend %freckles;
  margin-left: 350px;
}

.tongue {
  @include shape(circle, 50px, $pink);
  @include transition-duration(0.8s);
  margin: 240px 270px;
}

.dog {
  &:hover {
    .tongue{
      margin-top: 290px;
    }
  }
}
            
          
!
            
              /* Link to my mixin:
https://gist.github.com/una/7198256#file-shape-mixin

p.s. hover over the dog ;)
*/
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console