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.

            
              // DAILY CSS IMAGES 37 - YODA
// Original illustration by Konrad Kirpluk
// http://www.behance.net/kirpluk

.yoda
	.left
	.right
	.wrinkles
		.top
		.middle
		.bottom
	.head
	.body
		.cape
.original
	| Original illustration by 
	a(href='http://www.behance.net/kirpluk' target='_blank') Konrad Kirpluk
a(href='https://youtu.be/dZiNQJDzIgM' target='blank'): .watchme
		span
			i.fa.fa-youtube-play
		p watch me code this
            
          
!
            
              /* Original illustration by Konrad Kirpluk http://www.behance.net/kirpluk */

/* COLORS */
$bg: #e6e7e9
$green: #b9df00
$d-green: #94ad18
$black: #333
$beige: #ddc6ac
$grey: #ccc


/* MIXINS */
@mixin pseudo ($position: absolute, $display: block, $content: '')
	position: $position
	display: $display
	content: ''

@mixin size($height, $width)
	height: $height
	width: $width

@mixin cross($property, $val)
	-webkit-#{$property}: $val
	-moz-#{$property}: $val
	-ms-#{$property}: $val
	#{$property}: $val


*
	box-sizing: border-box

body, html
	@include size(100%, 100%)
	background: $bg

.yoda
	position: relative
	top: 15%
	margin: auto
	@include size(300px,300px)
	&::before
		@include pseudo
		bottom: 39%
		left: 30%
		@include size(3%,40%)
		border-radius: 50%
		background: $grey

/* EARS */	
.left
	position: absolute
	top: 10%
	left: 10%
	border-right: 90px solid $black
	border-top: 30px solid transparent
	border-bottom: 30px solid transparent
	z-index: 0
	&::before
		@include pseudo
		top: -29px
		left: 20px
		border-right: 90px solid $green
		border-top: 30px solid transparent
		border-bottom: 30px solid transparent
	&::after
		@include pseudo
		top: -14px
		left: 53px
		@include size(30px,30px)
		background: $d-green
		border-radius: 40% 0 0 40%
	
.right
	position: absolute
	top: 10%
	right: 10%
	border-left: 90px solid $black
	border-top: 30px solid transparent
	border-bottom: 30px solid transparent
	z-index: 0
	&::before
		@include pseudo
		top: -29px
		right: 20px
		border-left: 90px solid $green
		border-top: 30px solid transparent
		border-bottom: 30px solid transparent

%wrinkles
	@include pseudo
	top: 5px
	background: $black
	border-radius: 6px

%w-before
	left: -25px
	@include size(100%,90%)
	@include cross(transform,rotate(-25deg))
%w-after
	right: -25px
	@include size(100%,90%)
	@include cross(transform,rotate(25deg))

.wrinkles
	position: absolute
	top: 8%
	left: calc((100% - 30px)/2)
	@include size(40px,30px)
	z-index: 3

	.top
		position: absolute
		top: 0
		left: 5%
		@include size(6px,90%)
		background: $black
		border-radius: 6px
		&::before
			@extend %wrinkles
			@extend %w-before
		&::after
			@extend %wrinkles
			@extend %w-after
	
	.middle
		position: absolute
		top: calc((100% - 6px)/2)
		left: calc((100% - 85%)/2)
		@include size(6px,85%)
		background: $black
		border-radius: 6px
		&::before
			@extend %wrinkles
			@extend %w-before
		&::after
			@extend %wrinkles
			@extend %w-after
	
	.bottom
		position: absolute
		bottom: 0
		left: 10%
		@include size(6px,80%)
		background: $black
		border-radius: 6px
		&::before
			@extend %wrinkles
			@extend %w-before
		&::after
			@extend %wrinkles
			@extend %w-after
	
%eyes
	@include pseudo
	bottom: 10%
	@include size(12px,12px)
	background: $black
	border-radius: 50%

.head
	position: absolute
	left: 30%
	@include size(40%,40%)
	background: $green
	border-radius: 50%
	border-top: 10px solid $black
	border-left: 7px solid $black
	border-right: 7px solid $black
	border-bottom: 6px solid $black
	box-shadow: inset 10px 0 0 $d-green
	z-index: 2
	&::before
		@extend %eyes
		left: 20%
	&::after
		@extend %eyes
		right: 20%

%arms
	@include pseudo
	top: 26%
	@include size(33px,33px)
	background: $green
	border: 6px solid $black
	border-radius: 50%
	
.body
	position: absolute
	top: 27%
	left: calc((100% - 40%)/2)
	@include size(33%,40%)
	background: $green
	background-image: linear-gradient(-45deg, $beige 42%, $black 42%, $black 47%, transparent 47%), linear-gradient(45deg, $beige 42%, $black 42%, $black 47%, transparent 47%)
	border: 8px solid $black
	border-radius: 50% 50% 25px 25px
	z-index: 0
	&::before
		@extend %arms
		left: -22px
		box-shadow: inset 5px 0 0 $d-green
	&::after
		@extend %arms
		right: -22px
		box-shadow: inset 5px 0 0 $d-green

.original
	position: absolute
	bottom: 3%
	right: 3%

body, a
	text-decoration: none
	font-family: 'Open Sans', sans-serif
	color: $black

.watchme
	position: absolute
	bottom: 8%
	right: 5%
	text-align: center
	span
		background: #fff
	p
		color: $black
		font-family: 'Open Sans', sans-serif
		margin: 0
	.fa
		vertical-align: middle
		color: #ff0000
		font-size: 3em			
            
          
!
999px
Loading ..................

Console