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

              
                body.grid
	main.grid(aria-label='Shows the bottom two background layers in 3D. The first one from the bottom has an alpha of 1 all across the entire border-box. The second one, layered on top of it, has an alpha of 1 across the padding box, within the padding limit; it also has an alpha of 0 in the border area, outside the padding limit, but inside the border limit.')
		section.grid(aria-hidden='true')
			.lyr.grid(style='--i: 0')
				.cap 1st layer
				.box.grid
					.txt alpha is 
						code: strong 1
						|  everywhere
			.lyr.grid(style='--i: 1')
				.cap 2nd layer
				.box.grid
					.txt alpha is 
						code: strong 1
						|  in the 
						code padding-box
					.txt.grid
						.line between the 
							code border
							|  limit & the 
							code padding
							|  limit
						.line alpha is 
							code: strong 0
							|  in the 
							code border
							|  area
	footer.grid(aria-label='Legend matching the gold dashed border to the padding limit and the blue dashed border to the border limit')
		.inf(aria-hidden='true')
			code border
			|  limit
		.inf(aria-hidden='true')
			code padding
			|  limit
              
            
!

CSS

              
                $c-dark: #333;
$c-nght: #040404;
$c-lght: #c7c7c7;
$c-main: #d92727;
$c-secd: #ff6fff;

$c0: #ff7a18;
$c1: #af002d;
$c2: #319197;
$ax: 30deg;
$lw: 4px;

* { margin: 0; padding: 0; }

.grid { display: grid }

body {
	grid-template-rows: 1fr max-content;
	min-height: 100vh;
	background: $c-dark;
	color: $c-lght;
	font: 1em/ 1.5 ubuntu, trebuchet ms, sans-serif;
	
	::before { filter: drop-shadow(2px 2px 1px $c-nght) }
}

code {
	color: mix($c-secd, $c-lght, 35%);
	font: 1.125em/ 1.333 ubuntu mono, consolas, monaco monospace
}

section, div { transform-style: preserve-3d }

.lyr {
	--not-i: calc(1 - var(--i));
	--sgn-i: calc(2*var(--i) - 1);
	grid-area: 1/ 1;
	grid-template-columns: 9em 1fr;
	grid-gap: 1em;
	place-self: center;
	transform: translatey(calc(var(--sgn-i)*-47%));
}

.cap {
	place-self: center;
	font: 2em z003, segoe script, comic sans ms, sans-serif
}

.box {
	--h: clamp(8em, 35vh, 25em);
	--r: calc(.375*var(--h));
	--b: calc(.5*var(--r));
	box-sizing: border-box;
	width: clamp(9em, 50vw, 32em);
	height: var(--h);
	border-radius: var(--r);
	transform: perspective(25em) rotatex($ax);
	
	&::before {
		grid-area: 1/ 1;
		margin: -.5*$lw;
		border: dashed $lw $c0;
		border-radius: inherit;
		content: ''
	}
	
	:nth-child(1) > & { background: $c-nght }
	
	:nth-child(2) > & {
		background: 
			repeating-conic-gradient(rgba($c-nght, .5) 0% 25%, transparent 0% 50%) 
				50%/ 1em 1em;
	}
}

.txt {
	grid-area: 1/ 1;
	place-content: space-between center;
	text-align: center;
	
	&:first-child {
		position: relative;
		margin: var(--b);
		line-height: calc(var(--h) - var(--r));
		
		&::before {
			position: absolute;
			z-index: -1;
			inset: -.5*$lw;
			border: dashed calc(var(--i)*#{$lw}) $c1;
			border-radius: var(--b);
			background: $c-nght;
			content: ''
		}
	}
}

.line {
	line-height: var(--b)
}

footer {
	grid-template-columns: repeat(auto-fit, 13em);
	place-content: center;
	padding: .5em;
	box-shadow: 0 -1px 2px $c-nght
}

.inf {
	&::before {
		display: inline-block;
		margin-right: .25em;
		width: 2em; height: 0;
		border-top: dashed $lw $c0;
		vertical-align: middle;
		content: ''
	}
	
	&:nth-child(2)::before { border-color: $c1 }
}
              
            
!

JS

              
                /*
Created for my CSS-ing Candy Ghost Buttons https://css-tricks.com/css-ing-candy-ghost-buttons/ article on CSS-Tricks - check it out for context!
*/
              
            
!
999px

Console