Pen Settings



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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.


                - var n = 3;

h3 welcome to the dark side...
- for(var i = 0; i < n; i++) {
	input(type='checkbox' id=`toggle-${i}`)
		span.true on
		span.false off
- }


                $w: 10em;
$h: .25*$w;
$t: .35s;

* {
	margin: 0;
	padding: 0;
	font: inherit

body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-around;
	min-height: 100vh;
	font: 900 1em trebuchet ms, verdana, sans-serif;
	background: url( 50%/ cover #000;
	color: gold

h3 {
	position: absolute;
	top: 0; left: .25em;
	width: 100vh;
	transform-origin: 0 0;
	transform: rotate(-90deg) translate(-100%);
	font: 4em/ 1 cookie, cursive;
	text-align: center;
	text-shadow: 1px 1px 2px

[type='checkbox'] {
	position: absolute;
	left: -100vw;
	+ label {
		--s: 0;
		display: flex;
		position: relative;
		border: solid 2px transparent;
		border-top-width: 1px;
		width: $w; height: $h;
		border-radius: $h;
		box-shadow: 0 -.375rem 1rem rgba(#343232, .65), 
			0 .25rem 1rem .375rem rgba(#010101, .65), 
			0 0 4rem 2.5rem rgba(#2b2b2b, .35), 
			inset 0 -1px 1px black;
		background: linear-gradient(#010101, #323133) padding-box, 
			linear-gradient(#010101, #5e5d5f) border-box;
		color: #747474;
		cursor: pointer;
		&:after {
			--hl: #707070;
			position: absolute;
			top: 1px;
			border: solid 1px transparent;
			width: 2*$h; height: $h;
			border-radius: .5*$h;
			transform: translate(calc(var(--s)*#{$w - 2*$h}));
			box-shadow: inset 1px 1px var(--hl), 
				inset 1px 1px 3px rgba(#707070, .65), 
				.25rem .25rem .5rem rgba(#020202, .65), 
				.25rem .25rem 1.5rem rgba(#020202, .65);
			background: var(--inbg, linear-gradient(#262626, #565656)) padding-box, 
				linear-gradient(to right bottom, var(--hl), #020202) border-box;
			transition: $t ease-in-out;
			content: '';
	&:checked + label { --s: 1 }

span {
	display: grid;
	place-content: center;
	flex: 1;
	margin-top: 2px;
	color: hsl(0, 0%, calc(45% + var(--i)*47%));
	text-shadow: 1px 1px #000;
	text-transform: uppercase

.true { --i: 1 }

.false { --i: 0 }

label[for='toggle-1'] {
	&:before {
		position: absolute;
		top: 50%; right: calc(100% + .75em);
		transform: translatey(-50%);
		color: hsl(calc(var(--s)*95), 100%, 35%);
		font-size: 1.5rem;
		text-shadow: 0 0 5px;
		content: '✘';
		:checked + & { content: '✔' }

label[for='toggle-2'] {
	&:after {
		border-left-width: 0;
		--hl: #a0a0a0;
		--inbg: linear-gradient(#898787, #373737 50%, #313131 0, #2d2b2b);
	span {
		color: hsl(calc(var(--i)*90), 47%, calc(47% + var(--i)*3%));
		text-shadow: 0 0 13px, 0 0 7px