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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

	<h1>Pick up sticks</h1>
  <p>By selecting the one that's on top.</p>
	<input type="checkbox" id="stick-1" />
	<label for="stick-1">Stick 1</label>

	<input type="checkbox" id="stick-2" />
	<label for="stick-2">Stick 2</label>

	<input type="checkbox" id="stick-3" />
	<label for="stick-3">Stick 3</label>

	<input type="checkbox" id="stick-4" />
	<label for="stick-4">Stick 4</label>
	<input type="checkbox" id="stick-5" />
	<label for="stick-5">Stick 5</label>

	<input type="checkbox" id="stick-6" />
	<label for="stick-6">Stick 6</label>

	<input type="checkbox" id="stick-7" />
	<label for="stick-7">Stick 7</label>

	<input type="checkbox" id="stick-8" />
	<label for="stick-8">Stick 8</label>

	<input type="checkbox" id="stick-9" />
	<label for="stick-9">Stick 9</label>

	<input type="checkbox" id="stick-10" />
	<label for="stick-10">Stick 10</label>

 	<input type="checkbox" id="stick-11" />
	<label for="stick-11">Stick 11</label>

	<input type="checkbox" id="stick-12" />
	<label for="stick-12">Stick 12</label>

	<input type="checkbox" id="stick-13" />
	<label for="stick-13">Stick 13</label>

	<input type="checkbox" id="stick-14" />
	<label for="stick-14">Stick 14</label>
	<input type="checkbox" id="stick-15" />
	<label for="stick-15">Stick 15</label>

	<input type="checkbox" id="stick-16" />
	<label for="stick-16">Stick 16</label>

	<input type="checkbox" id="stick-17" />
	<label for="stick-17">Stick 17</label>

	<input type="checkbox" id="stick-18" />
	<label for="stick-18">Stick 18</label>

	<input type="checkbox" id="stick-19" />
	<label for="stick-19">Stick 19</label>

	<input type="checkbox" id="stick-20" />
	<label for="stick-20">Stick 20</label> 
	<div class="message winner">
		<div class="message-content">
			<h2>Wow you are AWESOME!</h2>
			<p>This may well be your super power, with great power comes great responsiblity.</p>
			<button type="reset">Do it again!</button>
	<div class="message gameover">
		<div class="message-content">
			<h2>Ah nuts, you stuffed up</h2>
			<p>Don&apos;t worry this isn't an essential life skill.</p>
			<button type="reset">Try again</button>


              html, body, form {
	height: 100%;
	margin: 0;

body {
	font-family: sans-serif;
	text-align: center;
	color: #333;
	font-size: 20px;
	perspective: 1000px;

h1, h2 {
	font-weight: normal;
	text-transform: uppercase;
	letter-spacing: 0.3rem;
header {
  position: absolute;
	z-index: 99;
  width: 100%;
  padding: 0.2rem 0 0;
  background: rgba(255,255,255,0.7);
h1 {
	font-size: 2rem;
   margin: 0;
h2 {
	font-size: 2rem;

p {
	font-size: 1.5rem;
	max-width: 30rem;
	margin: 0 auto 0.5rem;

button {
	background: #fff;
	border: solid 1px currentColor;
	font-size: 1rem;
	padding: 0.6rem;
	text-transform: uppercase;
	cursor: pointer;

button:hover {
	background-color: #444;
	color: #fff;

input {
	position: absolute;
	right: 100%;

label {
	position: fixed;
  text-indent: -100%;
  overflow: hidden;
	top: 50%;
	left: 50%;
	content: "";
	width: 80%;
	height: 10px;
	background: #eee;
	display: block;
	border: solid 3px currentColor;
	opacity: 1;
	transform: translate3d(-50%, -50%, 0);
	transition: all 300ms ease-out;
	border-radius: 50%;

	This is the reason why Sass is being used, everything else
	is standard CSS
@for $i from 1 through 20 {
	label:nth-of-type(#{$i}) {
	   transform: translate3d( -50%, -50%, 0) rotate(random(360) + deg);
	   margin: 10% - random(10);
	   z-index: 60 - $i;

input:first-of-type:checked + label, 
input:checked + label + input:checked + label {
	opacity: 0!important;
	pointer-events: none;

input:not(:checked) ~ input:checked ~ .gameover,
input:checked + label + input:checked + label + .winner {
	transform: translate3d(0, 0, 0); 

.message {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;	
	transform: translate3d(-100%, 0, 0);
	background: rgba(255,255,255,0.9);
	z-index: 200;

.message-content {
	position: absolute;
	width: 100%;
	top: 50%;
	transform: translate3d(0, -50%, 0);

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.