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.


	<div class="heading">5
			<h1>CSS Grid Layout</h1>
		<p>Using grid-template-columns: repeat();</p>
			<h2>demo <span class="demo-number">6</span></h2>
	<div class="intro">6
		<!-- CSS Grid Layout browser support text -->



                main {
	display: grid;
	height: 100vh;
	// one column layout by default for small screens
	grid-template-columns: 1fr;
	grid-template-rows: minmax(1fr, 500px);
	// when wider than my small breakpoint, grow into multi-column layout
	@include bp(small) {
		// use repeat(# of times, measurement) instead of declaring same value X times
		// replaces grid-template-columns: 1fr 1fr 1fr 1fr
		grid-template-columns: repeat(4, 1fr);

// override the default grid-template-columns and rows
.heading {
	grid-row: span 3;

.intro {
	grid-row: span 2;
	@include bp(small) {
		grid-column: span 3;

// Styles for fun
// -------------------------------------------------

@import ',700|Bungee+Shade|Josefin+Sans:400';

$color-1: rgb(119, 156, 7);
$color-2: adjust-hue($color-1, 120%);
// Amount of steps to iterate through color mix
$steps: 9;

// Mix colors to go from $color-1 ro @color-2 with 9 total steps
@for $i from 0 to $steps {
	div:nth-of-type(#{$i + 1}) {
		background: mix($color-1, $color-2, percentage($i / ($steps - 1)));

body {
	background: #424242;
	color: #fff;
	font-family: Comfortaa, sans-serif;
	font-weight: 300;
	letter-spacing: .03rem;
	line-height: 1;
	margin: 0 auto;	

h1 {
	font-size: 4rem;
	font-weight: 700;
	margin: 0;

div {
	color: #fff;
	padding: .85rem;

	@include bp(small) {
		padding: 1rem;	

h2 {
	font-size: 2.0rem;
	display: inline-block;
	font-weight: 300;
	line-height: 1;
	padding: 0;
	margin: 0;

.demo-number {
	font-family: 'Bungee Shade', cursive;
	font-size: 3.5rem;

a {
	color: hsl(317, 72%, 97%);
p {
	font-size: 1rem;
	line-height: 1.5;