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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

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


                <figure class="pie-chart">
	<h2>World electricity generation by source</h2>
		Coal 30<span style="color:#4e79a7"></span><br>
		Natural Gas 23<span style="color:#f28e2c"></span><br>
		Hydro 16<span style="color:#e15759"></span><br>
		Nuclear 10<span style="color:#76b7b2"></span><br>
		Renewable 6<span style="color:#59a14f"></span><br>
		Other 7<span style="color:#edc949"></span>
	<cite>International Energy Agency</cite>


                .pie-chart {
			circle closest-side,
			transparent 71%,
			white 0
			#4e79a7 0,
			#4e79a7 30%,
			#f28e2c 0,
			#f28e2c 61%,
			#e15759 0,
			#e15759 77%,
			#76b7b2 0,
			#76b7b2 87%,
			#59a14f 0,
			#59a14f 93%,
			#edc949 0,
			#edc949 100%
	position: relative;
	width: 500px;
	min-height: 350px;
	margin: 0;
	outline: 1px solid #ccc;
.pie-chart h2 {
	position: absolute;
	margin: 1rem;
.pie-chart cite {
	position: absolute;
	bottom: 0;
	font-size: 80%;
	padding: 1rem;
	color: gray;
.pie-chart figcaption {
	position: absolute;
	bottom: 1em;
	right: 1em;
	font-size: smaller;
	text-align: right;
.pie-chart span:after {
	display: inline-block;
	content: "";
	width: 0.8em;
	height: 0.8em;
	margin-left: 0.4em;
	height: 0.8em;
	border-radius: 0.2em;
	background: currentColor;