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

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.

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

              
                .wrapper
	.strawberry
	.cake
		.cheese
	.plate
              
            
!

CSS

              
                /* --- Globals --- */
* {
	box-sizing: border-box;
}
html, body {
	height: 100%;
}
body {
	display: flex;
	align-items: center;
	justify-content: center;

	background: #5B7C8D;
	
	font-size: 10px;
}
.wrapper {
	width: 30em;
	height: 30em;

	position: relative;
}


/* --- strawberry --- */
$s1: #C8101D;
$s2: darken($s1, 15%);
$s3: green;
$s4: darken($s3, 15%);
.strawberry {
	width: 1em;
	height: 1em;
	font-size: 60%;
	
	margin-top: 7em;
	margin-left: 6em;
	
	transform: rotate(-120deg);
	
	box-shadow:
		// Row 1
		-1em 0 0 $s1,
		-2em 0 0 $s1,
		-3em 0 0 $s1,
		// Row 2
		 0em 1em 0 $s1,
		-1em 1em 0 $s1,
		-2em 1em 0 $s1,
		-3em 1em 0 $s1,
		-4em 1em 0 $s1,
		// Row 3
		 0em 2em 0 $s1,
		-1em 2em 0 $s1,
		-2em 2em 0 $s1,
		-3em 2em 0 $s2,
		-4em 2em 0 $s1,
		// Row 4
		 1em 3em 0 $s1,
		 0em 3em 0 $s1,
		-1em 3em 0 $s1,
		-2em 3em 0 $s1,
		-3em 3em 0 $s1,
		-4em 3em 0 $s1,
		-5em 3em 0 $s1,
		// Row 5
		 1em 4em 0 $s1,
		 0em 4em 0 $s1,
		-1em 4em 0 $s2,
		-2em 4em 0 $s1,
		-3em 4em 0 $s1,
		-4em 4em 0 $s1,
		-5em 4em 0 $s1,
		// Row 6
		 2em 5em 0 $s1,
		 1em 5em 0 $s1,
		 0em 5em 0 $s1,
		-1em 5em 0 $s2,
		-2em 5em 0 $s1,
		-3em 5em 0 $s1,
		-4em 5em 0 $s1,
		-5em 5em 0 $s2,
		-6em 5em 0 $s1,
		// Row 7
		 2em 6em 0 $s1,
		 1em 6em 0 $s1,
		 0em 6em 0 $s1,
		-1em 6em 0 $s1,
		-2em 6em 0 $s1,
		-3em 6em 0 $s2,
		-4em 6em 0 $s1,
		-5em 6em 0 $s1,
		-6em 6em 0 $s1,
		// Row 8
		 2em 7em 0 $s1,
		 1em 7em 0 $s2,
		 0em 7em 0 $s1,
		-1em 7em 0 $s1,
		-2em 7em 0 $s1,
		-3em 7em 0 $s1,
		-4em 7em 0 $s1,
		-5em 7em 0 $s1,
		-6em 7em 0 $s1,
		// Row 9
		 2em 8em 0 $s1,
		 1em 8em 0 $s1,
		 0em 8em 0 $s1,
		-1em 8em 0 $s1,
		-2em 8em 0 $s1,
		-3em 8em 0 $s1,
		-4em 8em 0 $s2,
		-5em 8em 0 $s1,
		-6em 8em 0 $s1,
		// Row 10
		 1em 9em 0 $s1,
		 0em 9em 0 $s1,
		-1em 9em 0 $s1,
		-2em 9em 0 $s2,
		-3em 9em 0 $s2,
		-4em 9em 0 $s2,
		-5em 9em 0 $s1,
		// Row 11
		 2em 10em 0 $s4,
		 1em 10em 0 $s4,
		-1em 10em 0 $s1,
		-2em 10em 0 $s2,
		-3em 10em 0 $s1,
		// Row 12
		 1em 11em 0 $s4,
		 0em 11em 0 $s4,
		-1em 11em 0 $s4,
		-2em 11em 0 $s3,
		-3em 11em 0 $s3,
		-4em 11em 0 $s3,
		-5em 11em 0 $s3;
}


/* --- cheese --- */
$c1: #f5e8ba;
$c2: desaturate(darken($c1, 15%), 10%);
$c3: desaturate(#8C3F0B, 20%);
$c4: darken($c3, 10%);
$i1: #A50817;
$i2: darken($i1, 10%);
@function makeRow($length, $line, $color) {
	$c: $color;
	$x: $length;
	$y: $line;
  $val: 0 #{$line}em 0 $color;
  @for $i from 1 through $x {
    $val: #{$val}, -#{$i}em #{$y}em 0 #{$c};
  }
  @return $val;
}
.cheese {
	width: 1em;
	height: 1em;
	font-size: 10px;
	
	margin-top: 1em;
	margin-left: 27em;
	
	box-shadow:
		// Icing Marks
		-1em 0em 0 $i2,
		-2em 0em 0 $i2,
		-3em 0em 0 $i2,
		-5em 0em 0 $i2,
		-6em 0em 0 $i2,
		-7em 0em 0 $i2,
		-8em 0em 0 $i2,
		-9em 0em 0 $i2,
		-10em 0em 0 $i2,
		-11em 0em 0 $i2,
		-12em 0em 0 $i2,
		-13em 0em 0 $i2,
		-14em 0em 0 $i2,
		-15em 0em 0 $i2,
		-16em 0em 0 $i2,
		-19em 0em 0 $i2,
		-20em 0em 0 $i2,
		-21em 0em 0 $i2,
		-23em 0em 0 $i2,
		-24em 0em 0 $i2,
		
		-2em 1em 0 $i2,
		-24em 1em 0 $i2,
		-25em 1em 0 $i2,
		-24em 2em 0 $i2,
		-25em 2em 0 $i2,
		-25em 3em 0 $i2,
		-25em 4em 0 $i2,
		-25em 5em 0 $i2,
		
		// Icing Main
		-1em 2em 0 $i1,
		-2em 2em 0 $i1,
		-2em 3em 0 $i1,
		-3em 2em 0 $i1,
		-7em 2em 0 $i1,
		-8em 2em 0 $i1,
		-21em 2em 0 $i1,
		-22em 2em 0 $i1,
		-23em 2em 0 $i1,
		-24em 2em 0 $i1,
		-25em 2em 0 $i1,
		
		-22em 3em 0 $i1,
		-23em 3em 0 $i1,
		-24em 3em 0 $i1,
		-25em 3em 0 $i1,
		
		-23em 4em 0 $i1,
		-24em 4em 0 $i1,
		-25em 4em 0 $i1,
		
		-24em 5em 0 $i1,
		-25em 5em 0 $i1,
		
		-24em 6em 0 $i1,
		-25em 6em 0 $i1,
		
		-25em 7em 0 $i1,
		-25em 8em 0 $i1,
		
		// Cake Marks
		-9em 2em 0 $c2,
		-10em 2em 0 $c2,
		-11em 2em 0 $c2,
		-11em 3em 0 $c2,
		-12em 3em 0 $c2,
		
		-2em 5em 0 $c2,
		-3em 5em 0 $c2,
		-4em 5em 0 $c2,
		-5em 4em 0 $c2,
		-5em 3em 0 $c2,
		
		-2em 10em 0 $c2,
		-3em 11em 0 $c2,
		-4em 12em 0 $c2,
		-5em 10em 0 $c2,
		-5em 12em 0 $c2,
		
		-20em 8em 0 $c2,
		-21em 8em 0 $c2,
		-19em 9em 0 $c2,
		-18em 10em 0 $c2,
		-19em 10em 0 $c2,
		
		-20em 15em 0 $c1,
		-21em 15em 0 $c1,
		-19em 15em 0 $c1,
		-17em 15em 0 $c1,
		-18em 16em 0 $c1,
		
		-1em 19em 0 $c4,
		-2em 20em 0 $c4,
		-3em 20em 0 $c4,
		-4em 19em 0 $c4,
		-5em 19em 0 $c4,
		
		// Cake Main
		makeRow(24, 0, $i1),
		makeRow(25, 1, $i1),
		makeRow(25, 2, $c1),
		makeRow(25, 3, $c1),
		makeRow(25, 4, $c1),
		makeRow(25, 5, $c1),
		makeRow(25, 6, $c1),
		makeRow(25, 7, $c1),
		makeRow(25, 8, $c1),
		makeRow(25, 9, $c1),
		makeRow(25, 10, $c1),
		makeRow(25, 11, $c1),
		makeRow(25, 12, $c1),
		makeRow(25, 13, $c1),
		makeRow(25, 14, $c1),
		makeRow(25, 15, $c2),
		makeRow(25, 16, $c2),
		makeRow(25, 17, $c2),
		makeRow(25, 18, $c2),
		makeRow(25, 19, $c3),
		makeRow(25, 20, $c3);
}


/* --- plate --- */
$p1: #fff;
$p2: darken($p1, 20%);
.plate {
	width: 1em;
	height: 1em;
	font-size: 10px;
	
	margin-top: 20em;
	margin-left: 29em;
	
	background: $p1;
	
	box-shadow:
		// Plate Marking
		  0em 0em 0 $p2,
		-20em 0em 0 $p2,
		-21em 0em 0 $p2,
		-22em 0em 0 $p2,
		-23em 0em 0 $p2,
		-24em 0em 0 $p2,
		
		  0em 1em 0 $p2, 
		 -1em 1em 0 $p2,
		-23em 1em 0 $p2,
		-22em 1em 0 $p2,
		
		 -1em 2em 0 $p2,
		 -2em 2em 0 $p2,
		 -3em 2em 0 $p2,
		
		
		// Plate Main
		 -1em 2em 0 $p1,
		 -2em 2em 0 $p1,
		 -3em 2em 0 $p1,
		 -4em 2em 0 $p1,
		 -5em 2em 0 $p1,
		 -6em 2em 0 $p1,
		 -7em 2em 0 $p1,
		 -8em 2em 0 $p1,
		 -9em 2em 0 $p1,
		-10em 2em 0 $p1,
		-11em 2em 0 $p1,
		-12em 2em 0 $p1,
		-13em 2em 0 $p1,
		-14em 2em 0 $p1,
		-15em 2em 0 $p1,
		-15em 2em 0 $p1,
		-16em 2em 0 $p1,
		-17em 2em 0 $p1,
		-18em 2em 0 $p1,
		-19em 2em 0 $p1,
		-20em 2em 0 $p1,
		-21em 2em 0 $p1,
		-22em 2em 0 $p1,
		-23em 2em 0 $p1,
		-24em 2em 0 $p1,
		-25em 2em 0 $p1,
		-26em 2em 0 $p1,
		-27em 2em 0 $p1,
		-28em 2em 0 $p1,
		
		makeRow(29, 0, $p1),
		makeRow(29, 1, $p1);
}
              
            
!

JS

              
                
              
            
!
999px

Console