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.


Auto Save

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.


                <h1>Slotted elements are weak</h1>

<div class="card-demo">
	<h2 slot="heading">This heading slot is Navy</h2>

	<p slot="subheading">As defined in the Shadow DOM</p>

	<p>A <code>&lt;template&gt;</code> with a <code>shadowrootmode</code> attribute attaches a shadow DOM tree to it's parent element without the need for JavaScript. <br>This text is now purple.</p>
	<p>Unless the CSS tab adds styles to the document. These will override the <code>::slotted</code> styles in the Shadow DOM.</p>
	<template shadowrootmode="open">
			:host {
				margin-block-start: 1em;
				padding-block: 1ex;
				padding-inline: 3ch;
				color: purple;
				background: lightBlue;
			#header {
				color: steelBlue;
				font-size: 1.3333rem;
				font-weight: 300;
			::slotted(h2) {
				color: navy;
		<header id="header">
			<slot name="subheading"></slot>
			<slot name="heading"></slot>



                body {
	color: canvasText;

h2 {
	color: green;
p {
	color: blue;

/*	Component based override option */
	.card-demo h2 {
		color: navy;