Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource


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


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.


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.


                <div class="frame">
  <div class="center">

		<input type="checkbox" id="pretty-checkbox">
		<label for="pretty-checkbox"></label>


                // Change this font size and watch me grow
body {
	font-size: 100%;

// The box in which we live
.frame {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 400px;
	height: 400px;
	margin-top: -200px;
	margin-left: -200px;
	border-radius: 2px;
	box-shadow: 4px 8px 16px 0 rgba(0, 0, 0, 0.1);
	overflow: hidden;
	background-color: #ff0188;

// Used to center many things
.center {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);

// STEP 1
$cb: cubic-bezier(0.17, 0.67, 0.83, 0.67);
$checkbox-size: 1.5em;

// selecting/styling our checkbox 
// and label for the normal and :checked states
input[type="checkbox"] {
	// display: none;
	@extend .center;
	opacity: 0;
	// visibility: hidden;  // makes keyboard events (spacebar) not work
	pointer-events: none;

	& + label {
		@extend .center;
		width: $checkbox-size;
		height: $checkbox-size;
		border-radius: 50%;
		border: solid 2px white;
		cursor: pointer;
		box-shadow: 1px 1px 1px 1px rgba(3, 79, 32, 0.5);
		transition: box-shadow 0.4s $cb, background 0.4s $cb;

	// on :checked, give a background of purple and add an inner box-shadow of white (transitioned above)
	&:checked + label {
		background-color: purple;
		box-shadow: 1px 1px 1px 1px rgba(3, 79, 32, 0.5), 0 0 0 5px white inset;


                // jQuery v3.3.1 is supported