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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

              
                input(type='checkbox' id='i')
label(for='i') switch is on
	span(aria-hidden='true')
		code off
		code on
pre.ini
	span.token--prop --i
	span.token--punc :
	| 
	span.token--val
		span.token--num
p 
	code font-size
	|  is  
	code 2rem
	|  when switch is 
	em off
	|  
	code (--i: 0)
	|  and 
	code 10vw
	|  when switch is 
	em on
	|  
	code (--i: 1)
section
	h3 and stay alive...
pre
	span.token--func calc
	span.token--punc (
	span.token--arg
		span.token--punc (
		span.token--num 1
		|  
		span.token--oper -
		|  
		span.token--func var
		span.token--punc (
		span.token--arg --i
		span.token--punc )
		span.token--punc )
		span.token--oper *
		span.token--len 2rem
		|  
		span.token--oper + 
		|  
		span.token--func var
		span.token--punc (
		span.token--arg --i
		span.token--punc )
		span.token--oper *
		span.token--len 10vw
	span.token--punc )
		
              
            
!

CSS

              
                $w: 5em;
$h: .4*$w;
$hue: 120;
$sat: 65%;
$lum: 27%;
$c0: rgba(#fff, .8);

*, :before, :after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	font-size: inherit;
}

html { overflow-x: hidden }

body {
	--i: 0;
	--i1: 0;
	font: 1.25em trebuchet ms, verdana, arial, sans-serif;
	
	@media (max-width: 775px) { font-size: 1em }
	
	@media (max-width: 605px) { --wide: 0 }
	
	@media (max-width: 400px) { font-size: 4vw }
}

input[type='checkbox'] {
	position: absolute;
	left: -100vw;

	&:checked ~ * { --i: 1 }
}

pre, code {
	font: 1em/ 2 consolas, monaco, monospace
}

label, .ini {
	grid-column: 1/ 3;
	font-size: calc((2 - var(--wide))*1em);
}

label {
	display: block;
	position: relative;
	margin: 1em auto;
	width: $w; height: $h;
	text-indent: -100vw;
	cursor: pointer
}

pre {
	padding: 0 .75em;
	background: hsl(0, 0%, 19%);
	color: #fff
}

section {
	min-height: 1.5em;
	height: 35vmin;
	/* test background */
	background: 
		repeating-linear-gradient(-45deg, 
				gainsboro 0, gainsboro 2px, 
				transparent 0, transparent 5px);/**/
	/* live background *
	background: linear-gradient($c0, $c0), 
		url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/2017/kreator_rockharz_july_2018.jpg) 
			50%/ cover;/**/
	font: 900 calc((1 - var(--i))*2rem +  var(--i)*10vw) leckerli one, comic sans ms, cursive;
}

h3 {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 1.5em;
	height: 35vmin;
	color: #f90;
	text-shadow: 1px 1px 2px #000, 1px 1px 3px #000
}

code, em {
	--k: calc(1 - var(--i1) + (2*var(--i1) - 1)*var(--i));
	--c: hsl(calc(var(--i1)*#{$hue}), calc(var(--k)*#{$sat}), calc(var(--k)*#{$lum} + (1 - var(--k))*50%));
	
	&:nth-of-type(2n) { --i1: 1 }
}

p { padding: .5em }

em {
	color: var(--c);
	font-weight: 900;
	text-transform: uppercase
}

[aria-hidden] {
	position: absolute;
	top: 0;
	height: $h;
	display: flex;
	align-items: center;
	transform: translate(-2.5em);
	text-indent: 0;
	
	&:before, &:after {
		position: absolute;
		border-radius: 8px;
		z-index: -1;
		content: ''
	}
	
	&:before {
		top: 0; right: 25%; bottom: 0; left: 25%;
		border: solid 2px currentcolor;
	}
	
	&:after {
		top: 0; left: 25%;
		padding: 5px;
		width: .5*$w; height: $h;
		transform: translate(calc(var(--i)*100%));
		background: hsl(calc(var(--i)*#{$hue}), $sat, $lum) content-box;
	}
	
	code {
		display: grid;
		grid: 1fr/ 1fr 1fr;
		flex: 1;
		min-width: $w;
		color: hsl(0, 0%, calc((1 + var(--k))*50%));
		text-align: center;
		
		&:before {
			order: var(--i1);
			color: var(--c);
			counter-increment: c var(--i1);
			content: '(' counter(c) ')'
		}
	}
}

.ini {
	margin: 0 auto;
	width: 6.5em
}

.token {
	&--prop { color: #d9abff }
	
	&--punc { color: #dedede; }
	
	&--func { color: #abe4ff }
	
	&--arg {
		color: #ddffab;
		
		&.l0:before {
			content: '\A     '
		}
	}
	
	&--oper { color: lemonchiffon }
	
	&--sass { color: #ffdaab }
	
	&--num {
		color: #ffabab;
		
		.ini &:after {
			counter-increment: i var(--i);
			content: counter(i)
		}
	}
}
              
            
!

JS

              
                													
              
            
!
999px

Console