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.

<input type="checkbox" id="checkbox" name="checkbox" value="custom and accessible" checked>
<label for="checkbox">Custom and Accessible</label>
              @supports(-webkit-appearance: none) {
/* 	AKA, only do this if `-webkit-appearance: none` is supported. 
	Which means IE11 and Opera Mini will get the old browser-styled checkbox. 
	Which works just fine. Old browsers can get old looking things. */
 	input[type="checkbox"] {
		/*  Remove the default styling.
		    `-webkit-appearance` is not an official CSS property 
			& likely never will be. But it's also in 95% of browsers, 
			non-webkit included, yes, as a `-webkit` property. 
			Firefox, Edge, Chrome, Opera all implemented `-webkit-appearance`.  
			Plus it *will* stick around. Browsers can't remove it. 
			So use it like this...                                 */
		-webkit-appearance: none;
		/* Style the box. */
		width: 1.6rem;
		height: 1.6rem;
		border: 1px solid #808080;
	input[type="checkbox"]:focus {
		/* Style the box when it's focused. */
		border: 1px solid teal;
 	input[type="checkbox"]:checked {
		/* Prepare for placing the new checkmark. */
		position: relative;
		/* Do a bug fix to keep iOS from adding dark background. */
		background: none;
	input[id="checkbox"]:checked::after {
		/* Place (position) the new checkmark. */
		position: absolute;
		top: 0.36rem; 
		left: 0.12rem;
		/*  Create a checkmark in CSS. 
			Could use an SVG or `content: "✓";` instead. 
			This is a box, turned 45 degs, with a 
			left and bottom border to make the checkmark.
			Created using an empty pseudo-element.*/
		content: "";
		width: 1.0rem;
		height: 0.3rem;
		border: 4px solid black;
		border-right: none;
		border-top: none;
		transform: rotate(-45deg);

/* Add a bit of styling to the page & typography. Totally optional. */
body {
	margin: 2rem;
	font-family: Avenir, Roboto, sans-serif;

/* Tweek the vertical alignment. 
   Might not be needed given the layout context on your site. */
div {
	/* If Grid is not supported, all of this code will do nothing. 
	   All will be fine. Nothing will explode. Just won't be as pretty. */
	display: grid; 
	grid-template-columns: min-content 1fr; 
	gap: 0.6rem; 
	align-items: center;
label { 
	padding-top: 0.2rem; 

🕑 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.