Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <div aria-label="R2-D2 droid from Star Wars" role="img" class="r2d2"></div>
              
            
!

CSS

              
                /* R2-D2 */

$black: #000;
$grey: #abaaa6;
$white: #fff;
$blue: #426899;
$red: #be2e36;

.r2d2 {
	height: 24em;
	width: 22em;
	position: relative;
	
	&::after {
		background-color: $black;
		content: '';
		height: 1em;
		width: 1em;
		position: absolute;
		bottom: 1em;
		box-shadow: // Row 1
						9em -22em $black,
						10em -22em $black,
						11em -22em $black,
						12em -22em $black,
						// Row 2
						7em -21em $black,
						8em -21em $black,
						9em -21em $grey,
						10em -21em $blue,
						11em -21em $blue,
						12em -21em $grey,
						13em -21em $black,
						14em -21em $black,
						// Row 3
						6em -20em $black,
						7em -20em $blue,
						8em -20em $grey,
						9em -20em $blue,
						10em -20em $white,
						11em -20em $black,
						12em -20em $blue,
						13em -20em $grey,
						14em -20em $blue,
						15em -20em $black,
						// Row 4
						5em -19em $black,
						6em -19em $blue,
						7em -19em $grey,
						8em -19em $grey,
						9em -19em $blue,
						10em -19em $black,
						11em -19em $black,
						12em -19em $blue,
						13em -19em $grey,
						14em -19em $grey,
						15em -19em $blue,
						16em -19em $black,
						// Row 5
						5em -18em $black,
						6em -18em $grey,
						7em -18em $grey,
						8em -18em $grey,
						9em -18em $blue,
						10em -18em $blue,
						11em -18em $blue,
						12em -18em $blue,
						13em -18em $grey,
						14em -18em $grey,
						15em -18em $grey,
						16em -18em $black,
						// Row 6
						4em -17em $black,
						5em -17em $grey,
						6em -17em $blue,
						7em -17em $blue,
						8em -17em $grey,
						9em -17em $grey,
						10em -17em $grey,
						11em -17em $grey,
						12em -17em $grey,
						13em -17em $grey,
						14em -17em $grey,
						15em -17em $grey,
						16em -17em $grey,
						17em -17em $black,
						// Row 7
						4em -16em $black,
						5em -16em $grey,
						6em -16em $grey,
						7em -16em $grey,
						8em -16em $grey,
						9em -16em $blue,
						10em -16em $grey,
						11em -16em $blue,
						12em -16em $blue,
						13em -16em $blue,
						14em -16em $grey,
						15em -16em $blue,
						16em -16em $grey,
						17em -16em $black,
						// Row 8
						4em -15em $black,
						5em -15em $grey,
						6em -15em $blue,
						7em -15em $blue,
						8em -15em $grey,
						9em -15em $blue,
						10em -15em $grey,
						11em -15em $blue,
						12em -15em $red,
						13em -15em $blue,
						14em -15em $grey,
						15em -15em $blue,
						16em -15em $grey,
						17em -15em $black,
						// Row 9
						4em -14em $black,
						5em -14em $black,
						6em -14em $black,
						7em -14em $black,
						8em -14em $black,
						9em -14em $black,
						10em -14em $black,
						11em -14em $black,
						12em -14em $black,
						13em -14em $black,
						14em -14em $black,
						15em -14em $black,
						16em -14em $black,
						17em -14em $black,
						// Row 10
						2em -13em $black,
						3em -13em $black,
						4em -13em $black,
						5em -13em $white,
						6em -13em $white,
						7em -13em $white,
						8em -13em $white,
						9em -13em $white,
						10em -13em $white,
						11em -13em $white,
						12em -13em $white,
						13em -13em $white,
						14em -13em $white,
						15em -13em $white,
						16em -13em $white,
						17em -13em $black,
						18em -13em $black,
						19em -13em $black,
						// Row 11
						1em -12em $black,
						2em -12em $white,
						3em -12em $white,
						4em -12em $black,
						5em -12em $grey,
						6em -12em $grey,
						7em -12em $grey,
						8em -12em $white,
						9em -12em $blue,
						10em -12em $blue,
						11em -12em $blue,
						12em -12em $blue,
						13em -12em $white,
						14em -12em $grey,
						15em -12em $grey,
						16em -12em $grey,
						17em -12em $black,
						18em -12em $white,
						19em -12em $white,
						20em -12em $black,
						// Row 12
						1em -11em $black,
						2em -11em $white,
						3em -11em $white,
						4em -11em $black,
						5em -11em $grey,
						6em -11em $white,
						7em -11em $grey,
						8em -11em $white,
						9em -11em $white,
						10em -11em $white,
						11em -11em $white,
						12em -11em $white,
						13em -11em $white,
						14em -11em $grey,
						15em -11em $white,
						16em -11em $grey,
						17em -11em $black,
						18em -11em $white,
						19em -11em $white,
						20em -11em $black,
						// Row 13
						1em -10em $black,
						2em -10em $black,
						3em -10em $black,
						4em -10em $black,
						5em -10em $grey,
						6em -10em $white,
						7em -10em $grey,
						8em -10em $white,
						9em -10em $blue,
						10em -10em $blue,
						11em -10em $blue,
						12em -10em $blue,
						13em -10em $white,
						14em -10em $grey,
						15em -10em $white,
						16em -10em $grey,
						17em -10em $black,
						18em -10em $black,
						19em -10em $black,
						20em -10em $black,
						// Row 14
						2em -9em $black,
						3em -9em $white,
						4em -9em $black,
						5em -9em $grey,
						6em -9em $white,
						7em -9em $grey,
						8em -9em $white,
						9em -9em $white,
						10em -9em $white,
						11em -9em $white,
						12em -9em $white,
						13em -9em $white,
						14em -9em $grey,
						15em -9em $white,
						16em -9em $grey,
						17em -9em $black,
						18em -9em $white,
						19em -9em $black,
						// Row 15
						2em -8em $black,
						3em -8em $white,
						4em -8em $black,
						5em -8em $grey,
						6em -8em $white,
						7em -8em $grey,
						8em -8em $white,
						9em -8em $blue,
						10em -8em $grey,
						11em -8em $grey,
						12em -8em $blue,
						13em -8em $white,
						14em -8em $grey,
						15em -8em $white,
						16em -8em $grey,
						17em -8em $black,
						18em -8em $white,
						19em -8em $black,
						// Row 16
						2em -7em $black,
						3em -7em $white,
						4em -7em $black,
						5em -7em $grey,
						6em -7em $white,
						7em -7em $grey,
						8em -7em $white,
						9em -7em $blue,
						10em -7em $grey,
						11em -7em $grey,
						12em -7em $blue,
						13em -7em $white,
						14em -7em $grey,
						15em -7em $white,
						16em -7em $grey,
						17em -7em $black,
						18em -7em $white,
						19em -7em $black,
						// Row 17
						2em -6em $black,
						3em -6em $white,
						4em -6em $black,
						5em -6em $grey,
						6em -6em $white,
						7em -6em $grey,
						8em -6em $white,
						9em -6em $white,
						10em -6em $white,
						11em -6em $white,
						12em -6em $white,
						13em -6em $white,
						14em -6em $grey,
						15em -6em $white,
						16em -6em $grey,
						17em -6em $black,
						18em -6em $white,
						19em -6em $black,
						// Row 18
						2em -5em $black,
						3em -5em $white,
						4em -5em $black,
						5em -5em $grey,
						6em -5em $grey,
						7em -5em $grey,
						8em -5em $white,
						9em -5em $blue,
						10em -5em $blue,
						11em -5em $blue,
						12em -5em $blue,
						13em -5em $white,
						14em -5em $grey,
						15em -5em $grey,
						16em -5em $grey,
						17em -5em $black,
						18em -5em $white,
						19em -5em $black,
						// Row 19
						2em -4em $black,
						3em -4em $black,
						4em -4em $black,
						5em -4em $white,
						6em -4em $white,
						7em -4em $grey,
						8em -4em $white,
						9em -4em $blue,
						10em -4em $grey,
						11em -4em $black,
						12em -4em $blue,
						13em -4em $white,
						14em -4em $grey,
						15em -4em $white,
						16em -4em $white,
						17em -4em $black,
						18em -4em $black,
						19em -4em $black,
						// Row 20
						1em -3em $black,
						2em -3em $white,
						3em -3em $grey,
						4em -3em $black,
						5em -3em $white,
						6em -3em $white,
						7em -3em $grey,
						8em -3em $white,
						9em -3em $blue,
						10em -3em $black,
						11em -3em $grey,
						12em -3em $blue,
						13em -3em $white,
						14em -3em $grey,
						15em -3em $white,
						16em -3em $white,
						17em -3em $black,
						18em -3em $grey,
						19em -3em $white,
						20em -3em $black,
						// Row 21
						1em -2em $black,
						2em -2em $white,
						3em -2em $grey,
						4em -2em $black,
						5em -2em $black,
						6em -2em $black,
						7em -2em $black,
						8em -2em $black,
						9em -2em $black,
						10em -2em $black,
						11em -2em $black,
						12em -2em $black,
						13em -2em $black,
						14em -2em $black,
						15em -2em $black,
						16em -2em $black,
						17em -2em $black,
						18em -2em $grey,
						19em -2em $white,
						20em -2em $black,
						// Row 22
						0em -1em $black,
						1em -1em $white,
						2em -1em $white,
						3em -1em $white,
						4em -1em $black,
						8em -1em $black,
						9em -1em $white,
						10em -1em $grey,
						11em -1em $grey,
						12em -1em $white,
						13em -1em $black,
						17em -1em $black,
						18em -1em $white,
						19em -1em $white,
						20em -1em $white,
						21em -1em $black,
						// Row 23
						0em 0em $black,
						1em 0em $white,
						2em 0em $white,
						3em 0em $white,
						4em 0em $black,
						7em 0em $black,
						8em 0em $white,
						9em 0em $grey,
						10em 0em $white,
						11em 0em $white,
						12em 0em $grey,
						13em 0em $white,
						14em 0em $black,
						17em 0em $black,
						18em 0em $white,
						19em 0em $white,
						20em 0em $white,
						21em 0em $black,
						// Row 24
						0em 1em $black,
						1em 1em $black,
						2em 1em $black,
						3em 1em $black,
						4em 1em $black,
						7em 1em $black,
						8em 1em $black,
						9em 1em $black,
						10em 1em $black,
						11em 1em $black,
						12em 1em $black,
						13em 1em $black,
						14em 1em $black,
						17em 1em $black,
						18em 1em $black,
						19em 1em $black,
						20em 1em $black,
						21em 1em $black,
	}
}


/* ===================== Body ================= */

body {
	align-items: center;
	background-color: #4b4b4b;
	background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 40 40"%3E%3Cg fill-rule="evenodd"%3E%3Cg fill="%239C92AC" fill-opacity="0.4"%3E%3Cpath opacity=".5" d="M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0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10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z"/%3E%3Cpath d="M6 5V0H5v5H0v1h5v94h1V6h94V5H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
	display: flex;
	height: 100vh;
	justify-content: center;
}

              
            
!

JS

              
                // https://jackdomleo.dev

// The disadvantage to this method is that the complex box-shadow property is quite thirsty for web performance
              
            
!
999px

Console