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.

            
              <base href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/">
<header>
	<a href="https://thenewcode.com">
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 59.1 50" style="width:40px;height:40px;display:inline-block;vertical-align:middle;margin-right:.7rem; float: left;"><polygon fill="#2F8BCA" points="0,28.7 29.5,49.9 59.1,28.6 29.3,8.3"></polygon><polygon fill="#F4E302" points="5.5,18.4 29.3,35.3 53.4,18.4 29.1,1.8"></polygon><polygon fill="#F06823" points="29.3,20.9 44.6,10.1 29.3,0 14.4,10.1"></polygon>
	</svg>
	<h1>the new code</h1>
	</a>
</header>

<main>
		<article class="fullspan">
				<a href="http://thenewcode.com/1188/A-Complete-Web-Developer-Reading-List">
				 <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/oz-milky-2x.jpg" alt >
				</a>
	</article>
	
	<article class="headerTop" id="one">
		<a href="#" style="height: 0px; flex: 0"></a>
			<a href="http://thenewcode.com/1188/A-Complete-Web-Developer-Reading-List">
				<h2>A Complete Web Developer Reading List</h2>
			<p>I have been writing about web development for eight years. This reading list is the culmination of that experience.</p>
			</a>
		</article>

		<article id="two" class="headerLeft">
						<a href="http://thenewcode.com/1187/Time-Away">
						<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/iced-trees.jpg" alt="">
						</a>
						<a href="http://thenewcode.com/1187/Time-Away">
							<h2>Time Away</h2>
							<p>Yesterday I was reminded by a reader’s eMail that not everyone follows me on Twitter.</p>
						</a>
		</article>

		<article id="three" class="headerLeft">
						<a href="http://thenewcode.com/1184/A-WebGL-Tour-of-the-Solar-System-Mars-Part-Three">
						<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/intmars-2x.jpg" alt>
					</a>
				<a href="http://thenewcode.com/1184/A-WebGL-Tour-of-the-Solar-System-Mars-Part-Three">
						<h2>A WebGL Tour of the Solar System: Mars, Pt. Three</h2>
				<p>After addressing 3D space and lighting, I rather rushed to the end of the previous article </p>
			</a>
	</article>

	<article id="four" class="headerLeft">
					<a href="http://thenewcode.com/1107/Creating-an-SVG-Lotus-with-JS-and-CSS-Blend-Modes">
							<img src="https://thenewcode.com/assets/svg/petals.svg" alt>
					</a>
					<a href="http://thenewcode.com/1107/Creating-an-SVG-Lotus-with-JS-and-CSS-Blend-Modes">
						<h2>Creating an SVG Lotus with JS &amp; CSS Blend Modes</h2>
						<p>In a previous article I talked about SVG’s &lt;use&gt; element and how it can be used to quickly clone and transform copies of pre-existing elements.</p>
							</a>
	</article>

	<article id="five" class="headerTop">
					<a href="http://thenewcode.com/1172/Hard-Reset-Using-the-CSS-Initial-Value">
							<img src="https://thenewcode.com/assets/images/thumbnails/stop-button-2x.jpg" alt>
					</a>
					<a href="http://thenewcode.com/1172/Hard-Reset-Using-the-CSS-Initial-Value">
						<h2>Hard Reset: Using the CSS Initial Value</h2>
						<p>By definition, stylesheet development involves setting CSS properties to new values.</p>
					</a>
	</article>
			
		<article id="six" class="light headerTop">
					<a href="http://thenewcode.com/1181/Window-Window-Measuring-Screen-Sizes-with-JavaScript">
							<img src="https://thenewcode.com/assets/images/thumbnails/frosted-sillhouette-2x.jpg" alt id="milky">
					</a>
					<a href="http://thenewcode.com/1181/Window-Window-Measuring-Screen-Sizes-with-JavaScript">
						<h2>Measuring Screen Sizes with JavaScript</h2>
						<p>Judging screen sizes and resolution with JavaScript can be difficult</p>
					</a>
	</article>

	<article id="seven" class="headerTop">
					<a href="http://thenewcode.com/1178/Create-a-Word-Fade-In-Effect-Using-the-Web-Animation-API">
							<img src="https://thenewcode.com/assets/images/thumbnails/buddha-2x.png" alt>
					</a>
					<a href="http://thenewcode.com/1178/Create-a-Word-Fade-In-Effect-Using-the-Web-Animation-API">
						<h2>Create a Word Fade-In Effect Using the Web Animation API</h2>
						<p>Recently I’ve been exposed to several examples of word fade-in effects on the web.</p>
					</a>
	</article>
	<article id="eight" class="headerTop">
			<a href="http://thenewcode.com/1169/Balancing-Text-and-Images-with-Flexbox">
							<img src="https://thenewcode.com/assets/images/thumbnails/aloe-polyphylla-2x.jpg" alt>
				</a>
					<a href="http://thenewcode.com/1169/Balancing-Text-and-Images-with-Flexbox">
						<h2>Balancing Text and Images with Flexbox</h2>
						<p>This semester’s end-of-year work by my students often exhibited lengthy body copy creeping alongside and under images.</p>
				</a>
	</article>

	<article id="nine" class="headerTop">
			<a href="http://thenewcode.com/1183/To-the-Max-Using-Mathmin-and-max">
				<img src="https://thenewcode.com/assets/images/red-streaks-2x.jpg" alt="">
		  </a>
			<a href="http://thenewcode.com/1183/To-the-Max-Using-Mathmin-and-max">
						<h2>To the Max: Using Math.min and .max</h2>
						<p>Recently one of my students asked if it was possible to free-rotate an element on screen using mouse or touch movement.</p>
					</a>
	</article>
	
	<article id="ten" class="headerLeft">
			<a href="http://thenewcode.com/1186/Better-Links-for-Printed-Web-Pages-with-JavaScript">
						<img src="https://thenewcode.com/assets/images/thumbnails/david-foster-wallace-2x.jpg" alt>
			</a>
			<a href="http://thenewcode.com/1186/Better-Links-for-Printed-Web-Pages-with-JavaScript">
					<h2>Better Links for Printed Web Pages</h2>
					<p>In the world of print stylesheets, there’s long been a fairly well-established technique for expanding link URLs. </p>
				</a>
		</article>

	<article id="eleven" class="headerTop light">
					<a href="http://thenewcode.com/1168/Improve-the-Look-of-Links-with-the-CSS-Text-Decoration-Module">
							<img src="https://thenewcode.com/assets/images/thumbnails/para-2x.png" alt>
					</a>
					<a href="http://thenewcode.com/1168/Improve-the-Look-of-Links-with-the-CSS-Text-Decoration-Module">
						<h2>Improving the Look of Links with the CSS Text Decoration Module</h2>
						<p>Links make the web work. They also have some of the strictest styling limits, mostly due to security concerns.</p>
							</a>
	</article>

</main>

<footer>
	<nav class="pagenav">
		<a href="#" class="current">1</a>
		<a href="#">2</a>
		<a href="#">3</a>
		<a href="#">4</a>
		<a href="#">5</a>
		<a href="#" class="interpunct">&middot;&middot;&middot;</a>
		<a href="#">99</a>
		<a href="#">100</a>
	</nav>
</footer>
            
          
!
            
              $mobile: 400px;
$narrow: 800px;
$tablet: 1300px;
$medium: 1600px;
$wide: 1900px;
$extrawide: 2250px;
$ultrawide: 2700px;

* {
	box-sizing: border-box;
}
body {
	margin: 0;
	font-family: Gill Sans, Gill Sans MT, Calibri, sans-serif;
}
body > header {
	padding: .5rem;
}
body > header a, article, article a:last-of-type, .pagenav a {
	display: flex;
	justify-content: center;
}
body > header a {
	align-items: center;
}
a {
	text-decoration: none;
	color: inherit;
}
main {
  display: grid;
	@media all and (min-width: $mobile) {
		grid-template: repeat(9, 1fr)	/ repeat(2, 1fr);
	}
	@media all and (min-width: $narrow) {
		grid-template: repeat(9, 1fr)	/ repeat(3, 1fr);
	}
	@media all and (min-width: $tablet) {
		grid-template: repeat(4, 1fr)	/ repeat(4, 1fr);
	}
	@media all and (min-width: $medium) {
		grid-template: repeat(4, 1fr)	/ repeat(4, 1fr);
	}
	@media all and (min-width: $wide) {
		grid-template: repeat(3, 1fr)	/ repeat(5, 1fr);
	}
	@media all and (min-width: $extrawide) {
		grid-template: repeat(4, 1fr)	/ repeat(7, 1fr);
	}
	@media all and (min-width: $ultrawide) {
		grid-template: repeat(3, 1fr)	/ repeat(9, 1fr);
	}
}
article {
	position: relative;
 	a:first-of-type {
		line-height: 0;
		background: #fff;
		position: relative;
		@media all and (min-width: $mobile) {
			height: 50vw;
			flex: 1;
		}
		@media all and (min-width: $narrow) {
			height: 33.33vw;
		}
		@media all and (min-width: $tablet) {
			height: 25vw;
		}
		@media all and (min-width: $wide) {
			height: 20vw;
		}
		@media all and (min-width: $extrawide) {
			height: calc(100vw/7);
		}
		@media all and (min-width: $ultrawide) {
			height: calc(100vw/9);
		}
		display: block;
		width: 100%;
	}
	a:last-of-type {
		position: relative;
		transition: background .3s;
		background: #fff;
		display: flex;
		flex-direction: column;
		flex: 1;
		@media all and (min-width: $mobile) {
			height: 50vw;
			flex: 2;
		}
		@media all and (min-width: $narrow) {
			height: 33.33vw;
			flex: 1;
		}
		@media all and (min-width: $tablet) {
			height: 25vw;
		}
		@media all and (min-width: $wide) {
			height: 20vw;
		}
		@media all and (min-width: $extrawide) {
			height: calc(100vw/7);
		}
		@media all and (min-width: $ultrawide) {
			height: calc(100vw/9);
		}
		&:before {
			color: #fff;
			position: absolute;
			display: block;
			font-size: 2rem;
		}
	}

	img {
		transition: opacity .3s;
		width: 100%;
		max-width: 100%;
    image-rendering: -webkit-optimize-contrast;
		@media all and (min-width: $mobile) {
			height: 50vw;
		}
		@media all and (min-width: $narrow) {
			height: 33.33vw;
		}
		@media all and (min-width: $tablet) {
			height: 25vw;
		}
		@media all and (min-width: $wide) {
			height: 20vw;
		}
		@media all and (min-width: $extrawide) {
			height: calc(100vw/7);
		}
		@media all and (min-width: $ultrawide) {
			height: calc(100vw/9);
		}
	}
	&:hover img {
		opacity: .7;
	}
	&:hover a:last-child {
		background: #ddd;
	}
	&:hover a:last-child:before {
		color: #ddd;
	}
	h2 {
		font-weight: 300;
		margin-top: 0;
		line-height: 1.2;
	}
	h2, p {
		padding-right: 1.6rem;
		padding-left: 1.6rem;
	}
	p {
		line-height: 1.5;
		margin: 0;
		font-weight: 200;
	}
}
h1 { 
	font-weight: 300;
	color: rgba(0,0,0,0.8);
	font-size: 1.96rem;
}
.headerTop a {
	text-align: center;
	&:last-of-type:before {
		content: "▲";
		left: 45%;
		top: -1.8rem;
	}
}
.headerLeft a {
	h2, p { text-align: left; }
 	&:last-of-type:before {
		content: "◀";
		left: -1.53rem;
		top: 40%;
	}
}
.headerRight a {
	h2, p { text-align: right; }
	&:last-of-type:before {
		content: "▶";
		right: -1.53rem;
		top: 40%;
	}
}
.headerBottom a {
	text-align: center;
	&:last-of-type:before {
		content: "▼";
		left: 45%;
		bottom: -1.8rem;
	}
}
.light {
	a:last-of-type {
		color: #fff;
		background: #333;
			&:before { 
			color: #333;
		}
	}
	&:hover a:nth-of-type(2) {
		color: #333;
	}
}
.fullspan {
	@media all and (min-width: $mobile) {
		grid-column: 1 / 4;
		grid-row: 1;
	}
	@media all and (min-width: $narrow) {
		grid-column: 1 / 3;
	}
	h2 {
		@media all and (min-width: $tablet) {
			font-size: 2rem;
		}
		color: rgba(255,255,255,0.8);
		margin-top: 0;
		padding-top: 4.2rem;
		position: absolute;
		top: 0;
		width: 100%;
	}
}
#one {
	@media all and (min-width: $mobile) {
		grid-row: 2;
	  grid-column: 1;
	}
	@media all and (min-width: $narrow) {
		grid-column: 3;
		grid-row: 1;
	}
	@media all and (min-width: $tablet) {
		grid-column: 1;
		grid-row: 2;
	}
	@media all and (min-width: $ultrawide) {
		grid-column: 3;
		grid-row: 1;
	}
}
#two {
	@media all and (min-width: $mobile) {
		grid-column: 2;
		grid-row: 2 / 4;
	}
	@media all and (min-width: $narrow) {
		grid-column: 1;
		flex-direction: column;
	}
	@media all and (min-width: $tablet) {
		grid-column:3 / 5;
		grid-row: 1;
		flex-direction: row;
	}
	@media all and (min-width: $wide) {
		grid-column: 3 / 5;
		grid-row: 1;
		flex-direction: row;		
	}
	@media all and (min-width: $ultrawide) {
		grid-row:1;
		grid-column: 4 / 6;
		flex-direction: row;
	}
}
#three {
	@media all and (min-width: $mobile) {
		grid-column: 1;
		grid-row: 3 / 5;
		flex-direction: column;
	}
	@media all and (min-width: $narrow) {
		grid-column: 2;
		grid-row: 2 / 4;
		flex-direction: column-reverse;
	}
	@media all and (min-width: $tablet) {
		grid-column: 2 / 4;
		grid-row: 2;
		flex-direction: row;
	}
	@media all and (min-width: $wide) {
		grid-column: 4;
		grid-row: 2 / 4;
		flex-direction: column;
	}
	@media all and (min-width: $ultrawide) {
		grid-row: 2;
		grid-column: 8 / 10;
		flex-direction: row-reverse;
	}
}
#four {
	@media all and (min-width: $mobile) {
		grid-column: 2;
		grid-row: 4 / 6;
		flex-direction: column;
	}
	@media all and (min-width: $narrow) {
		grid-column: 3;
		grid-row: 2 / 4;
	}
	@media all and (min-width: $tablet) {
		grid-column: 2 / 4;
		grid-row: 3;
		flex-direction: row-reverse;
	}
	@media all and (min-width: $wide) {
		grid-column: 5;
		flex-direction: column;
		grid-row: 1 / 3;
	}
	@media all and (min-width: $ultrawide) {
		grid-row:1;
		grid-column: 8 / 10;
		flex-direction: row;
	}
}
#five {
	@media all and (min-width: $mobile) {
		grid-column: 2;
		grid-row: 4 / 6;
		flex-direction: column;
	}
	@media all and (min-width: $narrow) {
		grid-column: 1;
		grid-row: 4 / 6;
		flex-direction: column;
	}
	@media all and (min-width: $tablet) {
		grid-column: 4;
		grid-row: 2 / 4;
		flex-direction: column;
	}
	@media all and (min-width: $wide) {
		grid-column: 2 / 4;
		grid-row: 2;
		flex-direction: row;
	}
	@media all and (min-width: $ultrawide) {
		grid-column: 1 / 3;
		grid-row: 2;
		flex-direction: row;
	}
}
#six {
	flex-direction: column;
	@media all and (min-width: $mobile) {
		grid-column: 1;
		grid-row: 5 / 7;
	}
	@media all and (min-width: $narrow) {
		grid-column: 2;
		grid-row: 4 / 6;
	}
	@media all and (min-width: $tablet) {
		grid-column: 1;
		grid-row: 3 / 5;
	}
	@media all and (min-width: $wide) {
		grid-column: 1;
		grid-row: 3 / 5;
	}
	@media all and (min-width: $extrawide) {
		grid-column: 5;
		grid-row: 3 / 5;
	}
	@media all and (min-width: $ultrawide) {
		grid-column: 3 / 5;
		grid-row: 2;
		flex-direction: row;
	}
}
#seven {
	grid-column:3 / 5;
	grid-row: 3 / 6;
	@media all and (min-width: $mobile) {
		grid-row: 6 / 8;
		grid-column: 2;
		flex-direction: column;
	}
	@media all and (min-width: $narrow) {
		grid-row: 4 / 6;
		grid-column: 3;
		flex-direction: column;
	}
	a:first-of-type {
		flex: 2;
	}
	a:nth-of-type(2) {
		flex-direction: row;
		flex: 1;
	}
	a:nth-of-type(2) {
			flex-direction: column;
	}
	@media all and (min-width: $tablet) {
		grid-column: 4;
		grid-row: 4 / 6;
		a:first-of-type {
			flex: 1;
	 	}
		a:nth-of-type(2) {
			flex-direction: column;
			flex: 1;
		}
	}
	@media all and (min-width: $medium) {
		grid-row: 4 / 6;
		grid-column: 4;
		flex-direction: column;
	}
	@media all and (min-width: $wide) {
		grid-row: 3 / 5;
		grid-column: 5;
		flex-direction: column;
	}
	@media all and (min-width: $extrawide) {
		grid-column: 2 / 4;
		grid-row: 3;
		flex-direction: row-reverse;
		a:first-of-type {
			flex: 1;
		}
		a:nth-of-type(2) {
			flex-direction: column;
		}
	}
	@media all and (min-width: $ultrawide) {
		grid-column: 3 / 5;
		flex-direction: row-reverse;
	}
}
#eight {
	grid-column:5 / 6;
	grid-row: 3 / 4;
	@media all and (min-width: $mobile) {
		grid-row: 7 / 9;
		grid-column: 1;
		flex-direction: column;
	}
	@media all and (min-width: $narrow) {
		grid-row: 6 / 8;
		grid-column: 3;
		flex-direction: column;
	}
	@media all and (min-width: $tablet) {
		grid-column: 3;
		grid-row: 4 / 6;
	}
	@media all and (min-width: $medium) {
		grid-column: 3;
		grid-row: 4 / 6;
		flex-direction: column-reverse;
	}
	@media all and (min-width: $wide) {
		grid-column: 2 / 4;
		grid-row: 3;
		flex-direction: row-reverse;
	}
	@media all and (min-width: $extrawide) {
		grid-column: 6 / 8;
		grid-row: 1 / 4;
		flex-direction: column-reverse;
		a:first-of-type {
			flex: 2;
			img {
				height: calc(100vw/3.5);
			}
		}
		a:last-of-type {
			flex: 1;
		}
	}
	@media all and (min-width: $ultrawide) {
		grid-column: 6 / 8;
		grid-row: 1 / 4;
		flex-direction: column;
		a:first-of-type img {
				height: calc(100vw/4);
			}
	}
}
#nine {
	grid-column: 1 / 3;
	grid-row: 4 / 8;
	@media all and (min-width: $mobile) {
		grid-row: 8 / 10;
		grid-column: 2;
		flex-direction: column;
	}
	@media all and (min-width: $narrow) {
		grid-row: 6 / 8;
		grid-column: 1 / 3;
		flex-direction: column;
	}
	@media all and (min-width: $tablet) {
			grid-column: 1 / 2;
			grid-row: 8;
			flex-direction: row;
		}
		@media all and (min-width: $tablet) {
			grid-column: 2 / 5;
			grid-row: 6;
			flex-direction: row;
			a:first-of-type { 
				flex: 2;
			}
		}
	@media all and (min-width: $medium) {
			grid-column: 2 / 5;
			grid-row: 6;
			flex-direction: row;
		}
	  @media all and (min-width: $wide) {
			grid-column: 3 / 6;
			grid-row: 5;
			flex-direction: row;
		}
		@media all and (min-width: $extrawide) {
			grid-column: 1;
			grid-row: 3 / 5;
			flex-direction: column;
		}
		@media all and (min-width: $ultrawide) {
			grid-column: 1 / 3;
			grid-row: 3;
		  flex-direction: row-reverse;
			a:first-of-type, a:last-of-type {
				flex: 1;
			}
	}
}
#ten {
	grid-column:3 / 5;
	grid-row: 6;
	@media all and (min-width: $mobile) {
		grid-row: 10 / 12;
		grid-column: 2;
		flex-direction: column;
	}
	@media all and (min-width: $narrow) {
		grid-row: 8 / 10;
		grid-column: 1;
		flex-direction: column;
	}
	@media all and (min-width: $tablet) {
		grid-column: 1;
		grid-row: 5 / 7;
		flex-direction: column;
	}
	@media all and (min-width: $medium) {
		grid-column: 1;
		flex-direction: column;
		grid-row: 5 / 7;
	}
	@media all and (min-width: $wide) {
		grid-column: 3 / 5;
		flex-direction: row-reverse;
		grid-row: 4;
	}
		@media all and (min-width: $extrawide) {
			grid-column: 2 / 5;
			grid-row: 4;
			flex-direction: row;
			a:last-of-type {
				flex: 2;
			}
	 }
	@media all and (min-width: $ultrawide) {
		grid-column: 5;
		grid-row: 2 / 4;
		flex-direction: column;
	}
}
#eleven {
	grid-column:5;
	grid-row: 5 / 7;
	@media all and (min-width: $mobile) {
		grid-row: 9 / 12;
		grid-column: 1;
	}
	@media all and (min-width: $narrow) {
		grid-row: 8 / 10;
		grid-column: 2 / 4;
		flex-direction: column;
		img {
			object-fit:contain;
		}
	}
	@media all and (min-width: $tablet) {
		grid-column: 2;
		grid-row: 4 / 6;
		flex-direction: column;
	}
		@media all and (min-width: $extrawide) {
			grid-column: 6 / 8;
			grid-row: 4;
			flex-direction: row;
				a:first-of-type {
					flex: 1;
				}
				a:nth-of-type(2) {
					flex-direction: column;
			}
	  }
	@media all and (min-width: $ultrawide) {
			grid-column: 8 / 10;
			grid-row: 3;
		  flex-direction: row;
	}
}
.headerTop, .headerBottom, .fc {
	flex-direction: column;
}
.pagenav {
	text-align: center;
	margin: 2rem;
  a {
		text-decoration: none;
		border: 1px solid #000;
		display: inline-block;
		width: 2.5rem;
		height: 2.5rem;
		text-align: center;
		padding-top: .5rem;
		color: #fff;
		background: #333;
	}
}
a.interpunct {
		background: none;
		border: none;
		color: #000;
}
a.current {
		background: #DA291C;
}
.pagenav a:not(.current):hover {
			background: #000;
			transition: background .3s;
}
code {
	  word-spacing: -0.3ch;
}
            
          
!
            
              !function(t,n){var u,e=t.jQuery||t.Cowboy||(t.Cowboy={});e.throttle=u=function(t,u,o,i){function r(){function e(){c=+new Date,o.apply(f,g)}function r(){a=n}var f=this,d=+new Date-c,g=arguments;i&&!a&&e(),a&&clearTimeout(a),i===n&&d>t?e():u!==!0&&(a=setTimeout(i?r:e,i===n?t-d:t))}var a,c=0;return"boolean"!=typeof u&&(i=o,o=u,u=n),e.guid&&(r.guid=o.guid=o.guid||e.guid++),r},e.debounce=function(t,e,o){return o===n?u(t,e,!1):u(t,o,e!==!1)}}(this);

forEach = Array.prototype.forEach;
replaceHeaders();

window.onresize = function(){
	Cowboy.debounce( 250, replaceHeaders() );
}

function replaceHeaders() {
	forEach.call(document.querySelectorAll("article[id]"), function(article) {

		let flex = window.getComputedStyle(article, null).getPropertyValue("flex-direction"),
		row = window.getComputedStyle(article, null).getPropertyValue("grid-row");
		
		if (flex == "row") {	
			article.className = article.className.replace(/\header.*?\b/g,'headerLeft');
		}
		if (flex == "column") {
			article.className = article.className.replace(/\header.*?\b/g, 'headerTop');
		}
		if (flex == "column-reverse") {
			article.className = article.className.replace(/\header.*?\b/g, 'headerBottom');
		}
		if (flex == "row-reverse") {
			article.className = article.className.replace(/\header.*?\b/g, "headerRight");
		}
		
 if (article.id == "one" && row == "1 / auto") {
				article.className = article.className.replace(/\header.*?\b/g, 'headerLeft');
			} else {
				article.className.replace(/\header.*?\b/g,'headerTop');
			}
	})
}
            
          
!
999px
🕑 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.

Console