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

              
                .container
	<a class="title" href="http://fontmeme.com/simpsons-font/"><img src="http://fontmeme.com/embed.php?text=The%20Simpsons&name=Simpson.ttf&size=50&style_color=ffffff" alt="Simpsons Font"></a>
	.sofa
		.sofa-arm.right
			.end
		.sofa-arm.left
			.end
		.sofa-seat
		.sofa-base
		.homer
			.head
				.hair
				.brow
				.eye.left
				.eye.right
				.ear
				.nose
				.beard
				.mouth
			.neck
			.collar.left
			.collar-neck.left
			.collar.right
			.collar-neck.right
			.body
			.belly
			.bum
			.hand.left
			.hand.right
			.crotch
			.leg.left
			.leg.right
			.shoe.left
			.shoe.right
		.homer-sleeve
		.homer-arm
			.elbow
				.arm-lower
					- 3.times do
						%span
		.marge
			.head
				.hair
					.front
						- (1..10).each do |i|
							%span{:class => "hair_#{i}"}
					.back
						- (1..10).each do |i|
							%span{:class => "hair_#{i}"}
				.eye.left
				.eye.right
			.body
				.dress-bottom
				.dress-top
              
            
!

CSS

              
                @import "compass";

body {
	background-color: #FCEFA7;
	@include filter-gradient(#FCEFA7, #FDDB5A, horizontal);
	@include background-image(radial-gradient(center, ellipse cover, #FCEFA7 0%, #FDDB5A 50%, #FDDB5A 100%));

	.container {
		max-width: 500px;
		padding: 0;
		margin: 0 auto 0 auto;
		min-height: 400px;

		.title {
			display: block;
			text-align: center;
		}
	}
}
	
.sofa * {
	position: absolute;
}

:before, :after {
	position: absolute;
	content: "";
	width: 0;
	height: 0;
}

/* ----- z-index ------ */

.homer-arm			{ z-index: 12; }
.homer-sleeve		{ z-index: 11; }
.sofa-arm.left 	{ z-index: 10; }
.homer 				{ z-index: 9; }
.marge				{ z-index: 8; }
.lisa					{ z-index: 7; }
.maggie				{ z-index: 6; }
.bart					{ z-index: 5; }
.sofa-seat			{ z-index: 4; }
.sofa-base			{ z-index: 3; }
.sofa-arm.right 	{ z-index: 2; }
.sofa 				{ z-index: -1; }

$skin-color: #FFCD38;
$sofa-color: #8A3B12;
$border-size: 1px;
$border: $border-size solid #222222;

.sofa {
	position: relative;
	height: 170px;
	width: 370px;
	margin: 120px 20px 0 20px;
	background: $sofa-color;
	border: $border;
	@include border-radius(50px 60px 0 0);
	@include transform(skewY(-2deg));
	
	&:before {
		top: -3px;
		left: 15px;
		height: 100px;
		width: 100px;
		@include border-radius(50px 0 0 0);
		border-left: $border;
	}
	
	$arm-width: 90px;
	$arm-depth: 45px;
	$arm-skew: 30deg;

	.sofa-arm {
		bottom: -(29px + $border-size);
		width: $arm-width;
		height: 130px;
		background: $sofa-color;
		border: $border;
		@include border-radius(45px 20px 5px 5px / 60px 20px 5px 5px);
		@include transform(skewY($arm-skew));

		&.left {
			left: -$border-size;
		}

		&.right {
			right: -($border-size + $arm-width) + ($arm-depth / 1.5);
		}

		&:before {
			bottom: -(15px + $border-size);
			left: -$border-size;
			height: 50%;
			width: calc(100% - #{$arm-depth});
			background: $sofa-color;
			border-bottom: $border;
			border-left: $border;
			$botttom-skew: $arm-skew - 4;
			@include border-radius(0 0 4px 2px);
			@include transform(skewY($botttom-skew));
		}

		.end {
			right: -$border-size;
			bottom: -(15px + $border-size);
			height: calc(100% + 7px);
			width: $arm-depth;
			border: $border;
			background: $sofa-color;
			@include transform(skewY(-$arm-skew));
			@include border-radius(20px 20px 5px 5px);

			&:before {
				left: 7%;
				bottom: 0;
				width: 80%;
				height: 97%;
				border: $border;
				border-bottom: 0;
				@include border-radius(20px 20px 0 0);
			}
		}
	}

	.sofa-seat {
		top: 111px;
		left: 2px + $arm-depth + $border-size;
		width: 312px;
		height: $arm-width - $arm-depth;
		background: $sofa-color;
		border: $border;
		@include border-radius(5px);
		@include transform(skewX(60deg) rotateX(55deg));
	}

	.sofa-base {
		bottom: -58px;
		left: 43px + $arm-depth + $border-size;
		height: 80px;
		width: 294px;
		border: $border;
		background: $sofa-color;
		@include border-radius(5px);

		&:before {
			width: 100%;
			height: 22px;
			border-bottom: $border;
			@include border-radius(5px);
		}
	}
	
	@mixin eyes($size, $position) {
		height: $size;
		width: $size;
		background: #FFFFFF;
		border: $border;
		@include border-radius(50%);
		
		&.left {
			z-index: 2;
			left: $position;
		}
		
		&.right {
			left: $position + ($size / 1.1);
			z-index: 1;
			
			&:before {
				left: 60%;
			}
		}
		
		&:before {
			top: 50%;
			left: 50%;
			height: 3px;
			width: 3px;
			background: black;
			@include border-radius(50%);
		}
	}
		
	$homer-shirt-color: #FFFFFF;

	.homer {
		$homer-width: 75px;
		$homer-height: 130px;
		$homer-hair-color: #694E49;
		
		$pants-color: #4369BC;

		height: $homer-height;
		width: $homer-width;
		top: 10px;
		left: 48px;

		$homer-head-height: 100px;
		$homer-head-width: 65px;

		.head {
			top: -128px;
			left: -10px;
			width: $homer-head-width;
			height: $homer-head-height;
			background: $skin-color;
			@include border-radius(50% 50% 50% 10% / 35% 30% 50% 50%);
			@include transform(rotate(-4deg));
			z-index: 3;
			border: $border;
			border-bottom-color: transparent;
			
			.hair {
				top: -8px;
				height: 110px;
				width: 50px;
				
				&:before,
				&:after {
					height: 100%;
					width: 100%;
					border: $border-size solid transparent;
					border-top-color: #000000;
					@include border-radius(50%);
					@include transform(rotate(-12deg));
				}
				
				&:before {
					left: 8px;
				}
				
				&:after {
					left: 16px;
				}
			}
			
			.brow {
				top: 32px;
				right: -6px;
				width: 40px;
				height: 20px;
				background: $skin-color;
				border: $border;
				border-top-color: transparent;
				border-bottom-color: transparent;
				border-left-color: transparent;
				@include border-radius(50%);
				@include transform(rotate(-4deg));
				z-index: 5;
			}
			
			.eye {
				@include eyes(29px, 16px);
				
				$eye-top: 40px;
				
				&.left {
					top: $eye-top;
					z-index: 8;
				}
				
				&.right {
					top: $eye-top + 2px;
					z-index: 6;
				}
			}
			
			.nose {
				top: 65px;
				right: -3px;
				width: 40px;
				height: 12px;
				z-index: 7;
				background: $skin-color;
				border: $border;
				border-left-color: transparent;
				@include border-radius( 0 60% 30% 0 / 0 45% 45% 0);
				@include transform(rotate(0deg));
			}
			
			.ear {
				top: 60px;
				left: -7px;
				height: 16px;
				width: 12px;
				border: $border;
				border-right-color: transparent;
				background: $skin-color;
				@include border-radius(50%);
				
				&:before {
					top: 30%;
					left: 12%;
					width: 70%;
					height: 40%;
					border-top: $border;
					@include transform(rotate(45deg));
					@include border-radius(45%);
				}
				
				&:after {
					top: 37%;
					left: 35%;
					width: 40%;
					height: 20%;
					border-top: $border;
					@include transform(rotate(-60deg));
					@include border-radius(45%);
				}
			}
			
			.beard {
				top: 76px;
				right: 5px;
				height: 38px;
				width: 45px;
				background: #C7A47D;
				border: $border;
				@include border-radius(50% 10% 30% 50%);
				@include transform(rotate(8deg));
				
				&:before {
					top: -3px;
					right: -9px;
					width: 19px;
					height: 29px;
					background: inherit;
					border-right: $border;
					border-bottom: $border;
					@include border-radius( 0 85% 40% 0 / 0 80% 20% 0 );
					@include transform(rotate(-2deg));
				}
			}
		}

		$homer-neck-height: 60px;
		$homer-neck-width: 50px;

		.neck {
			top: -($homer-neck-height - 10px);
			left: -5px;
			height: $homer-neck-height;
			width: $homer-neck-width;
			background: $skin-color;
			border-left: $border;
			border-right: $border;
			z-index: 2;
			@include border-radius( 20% 5% 1% 1% / 90% 5% 1% 1%);
		}
		
		.collar {
			top: -10px;
			height: 16px;
			width: 34px;
			background: $homer-shirt-color;
			border: $border;
			
			&.left {
				left: -12px;
				z-index: 3;
				@include transform(rotate(20deg) skewX(4deg));
				@include border-radius( 1% 1% 1% 50% / 1% 1% 1% 20% );
			}
			
			&.right {
				top: -13px;
				left: 22px;
				z-index: 1;
				@include transform(rotate(15deg) skewX(30deg));
				@include border-radius( 1% 20% 20% 50% / 1% 30% 50% 20% );
			}
		}

		.collar-neck {
			top: 1px;
			height: 15px;
			width: 22px;
			border-top: $border;
			z-index: 2;
			
			&.left {
				background: $homer-shirt-color;
				left: 20px;
				@include transform(rotate(35deg));
			}
			
			&.right {
				top: -3px;
				left: 44px;
				@include transform(rotate(-52deg));
				
				&:before /* hide */ {
					top: 0;
					height: 10px;
					width: 8px;
					background: $homer-shirt-color;
				}
			}
		}

		.body {
			top: 0;
			left: 0;
			height: $homer-height;
			width: $homer-width;
			background: $homer-shirt-color;
			border-top: $border;
			border-right: $border;
			@include border-radius(30% 50% 10% 1% / 20% 50% 20% 1%);
			z-index: 1;
		}

		.belly {
			bottom: 22px;
			left: 35px;
			width: 70px;
			height: 80px;
			background: $homer-shirt-color;
			border-right: $border;
			border-bottom: $border;
			@include border-radius(1% 80% 25% 60% / 1% 90% 10% 20%);
			@include transform(rotate(-10deg));
			z-index: 4;

			&:before /* hide */ {
				height: 30px;
				width: 30px;
				top: -5px;
				left: 11px;
				background: $homer-shirt-color;
				@include transform(rotate(-15deg));
			}
		}

		.bum {
			bottom: 0;
			left: 28px;
			width: $homer-width + 5px;
			height: 40px;
			background: $pants-color;
			border-right: $border;
			border-bottom: $border;
			@include border-radius( 1% 1% 40% 1% / 1% 1% 90% 1% );
			z-index: 3;
		}
		
		$leg-width: 50px;
		
		.leg {
			top: 115px;
			width: $leg-width;
			height: 100px;
			background: $pants-color;
			border: $border;
			@include border-radius( 1% 50% 40% 60% / 1% 30% 10% 10%);
			
			$leg-position: 42px;
			
			&.left {
				left: $leg-position;
				z-index: 4;
			
				&:before /* hide */ {
					top: -3px;
					height: 30px;
					width: 30px;
					background: $pants-color;
				}
			}
			
			&.right {
				left: $leg-position + $leg-width - 10px;
				z-index: 2;
			
				&:before /* hide */ {
					top: -18px;
					height: 45px;
					width: 50px;
					background: $pants-color;
					border-top: $border;
					border-right: $border;
					@include border-radius( 1% 90% 1% 1% / 1% 80% 1% 1%);
				}
			}
			
			&:after {
				bottom: 15px;
				width: 100%;
				height: 80%;
				border-bottom: $border;
				@include border-radius(inherit);
			}
		}
		
		$shoe-height: 38px;
		$shoe-width: 55px;
		$shoe-rotate: 15deg;
		$shoe-color: #757F88;
		
		.shoe {
			top: 200px;
			width: $shoe-width;
			height: $shoe-height;
			background: #757F88;
			border: $border;
			@include border-radius(1% 90% 15% 50% / 1% 85% 15% 50%);
			@include transform(rotate($shoe-rotate));
			
			$shoe-position: 49px;
			
			&.left {
				left: $shoe-position;
				z-index: 2;
			}
			
			&.right {
				left: $shoe-position + ($leg-width - 7px);
				z-index: 1;
			}
			
			&:before /* back */ {
				top: 1px;
				left: -9px;
				width: 15px;
				height: 30px;
				border-left: $border;
				background: inherit;
				@include transform(rotate(-$shoe-rotate));
			}
			
			&:after /* heel */ {
				bottom: 1px;
				left: -5px;
				height: 6px;
				width: 12px;
				border-left: $border;
				border-right: $border;
				border-bottom: $border;
				background: inherit;
				@include transform(rotate(5deg) skew(20deg));
			}
		}
	}
	
	.homer-sleeve {
		top: 8px;
		left: 15px;
		height: 40px;
		width: 48px;
		border: $border;
		background: $homer-shirt-color;
		@include transform(rotate(30deg));
		@include border-radius( 50% 50% 50% 50% / 80% 80% 15% 15% );
		
		&:before {
			bottom: -10px;
			width: 100%;
			height: 20px;
			border-top: $border;
			@include border-radius(50% 50% 1% 1% / 50% 50% 1% 1%);
		}
	}
	
	$arm-width: 40px;
	$arm-rotate: 30deg;
	
	.homer-arm {
		top: 37px;
		left: 8px;
		height: 30px;
		width: $arm-width;
		background: $skin-color;
		border-left: $border;
		border-right: $border;
		$lower-arm-rotate: $arm-rotate - 5;
		@include transform(rotate($lower-arm-rotate));
		@include border-radius(40% 60% 1% 1% / 13% 32% 1% 1%);
		
		.elbow {
			bottom: -26px;
			left: -$border-size;
			height: 25px;
			width: $arm-width;
			border-left: $border;
			border-bottom: $border;
			background: $skin-color;
			@include border-radius(1% 1% 40% 50% / 1% 1% 50% 90%);
			
			.arm-lower {
				bottom: 13px;
				left: $arm-width - 23px;
				width: 73px;
				height: $arm-width - 4px;
				background: $skin-color;
				border-top: $border;
				border-bottom: $border;
				border-right: $border;
				@include transform(rotate(-25deg));
				@include border-radius(30% 70% 1% 10% / 20% 90% 1% 10% );
				
				&:before /* hide */ {
					left: -5px;
					top: -5px;
					height: 20px;
					width: 20px;
					background: $skin-color;
				}
				
				$finger-width: 8px;
				
				span {
					width: $finger-width;
					height: 16px;
					background: $skin-color;
					border: $border;
					border-top-color: transparent;
					@include border-radius(0 30% 50% 50%);
					@include transform(rotate(-25deg));
					
					$fingers: 3;
					
					@for $i from 1 through $fingers {
						&:nth-of-type(#{$i}) {
							left: 59px + ($finger-width * ($i - 1)) - ($i * 3);
							bottom: -(16px - ($i * 4));
							z-index: 4 - $i;
							$rotate-fingers: 40deg - ($i * 4);
							@include transform(rotate(-$rotate-fingers));
						}
					}
				}
			}
		}
	}
	
	.marge {
		$marge-width: 75px;
		$marge-height: 130px;
		$marge-hair-color: #4673AC;
		
		$dress-color: #98CB54;

		height: $marge-height;
		width: $marge-width;
		top: 10px;
		left: 110px;

		$marge-head-height: 70px;
		$marge-head-width: 60px;

		.head {
			top: -80px;
			left: -10px;
			width: $marge-head-width;
			height: $marge-head-height;
			background: $skin-color;
			@include border-radius(50% 50% 50% 20% / 35% 30% 50% 50%);
			@include transform(rotate(-4deg));
			z-index: 3;
			border: $border;
			border-bottom-color: transparent;
			
			.hair {
				top: -130px;
				left: 0px;
				height: 150px;
				width: 65px;
				background: $marge-hair-color;
				@include border-radius( 35% 50% 25% 25% / 10% 42% 8% 5% );
				@include transform(rotate(-12deg));
				
				$bump-height: 16px;
				$bump-width: 10px;
				
				.front,
				.back {
					height: 100%;
					width: $bump-height;
					
					span /* bump */ {
						height: $bump-height;
						width: $bump-width;
						border: $border;
						@include border-radius(50%);

						@for $i from 1 through 10 {
							&.hair_#{$i} {
								top: ($bump-height - ($border-size * 2)) * ($i - 1);
							}
						}

						&.hair_1 { right: 17px; @include transform(rotate(-20deg)); }
						&.hair_2 { right: 13px; @include transform(rotate(-18deg)); }
						&.hair_3 { right: 10px; @include transform(rotate(-15deg)); }
						&.hair_4 { right: 7px; @include transform(rotate(-13deg)); }
						&.hair_5 { right: 5px; @include transform(rotate(-11deg)); }
						&.hair_6 { right: 3px; @include transform(rotate(-9deg)); }
						&.hair_7 { right: 2px; @include transform(rotate(-7deg)); }
						&.hair_8 { right: 1px; @include transform(rotate(0deg)); }
						&.hair_9 { right: 0px; @include transform(rotate(0deg)); }
						&.hair_10 { right: 0px; @include transform(rotate(0deg)); }
					}
				}
				
				.front { right: -6px; }
				.back { left: -6px; }
			}
			
			.eye {
				@include eyes(25px, 16px);
				
				$eye-top: 30px;
				
				&.left {
					top: $eye-top;
					z-index: 8;
				}
				
				&.right {
					top: $eye-top + 3px;
					z-index: 6;
				}
			}
		}
		
		.body {
			
			.dress-bottom {
				top: 88px;
				left: 45px;
				background: $dress-color;
				height: 105px;
				width: 80px;
				border-right: $border;
				border-bottom: $border;
				@include border-radius( 0 80% 30% 70% / 0 35% 10% 30% );
				@include transform(rotate(2deg));
				
				&:before {
					top: -20px;
					left: -6px;
					background: $dress-color;
					height: 100px;
					width: 60px;
					border-right: $border;
					@include transform(rotate(-80deg));
					@include border-radius( 0 20% 30% 0 / 0 20% 50% 0 );
				}
			}
				
			.dress-top {
				background: $dress-color;
				height: 100px;
				width: 80px;
				top: 10px;
				left: 0px;
				@include transform(rotate(-5deg));
				border-right: $border;
				
				&:after {
					
				}
			}
		}
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console