Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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.

HTML

              
                article.o-grid
	header.o-grid__area.o-header
		h1.c-heading.c-heading--prim Salvador Dalí
		h2.c-heading.c-heading--sec “When you are a genius, you do not have the right to die, because we are necessary for the progress of humanity.”
	figure.o-grid__area.o-grid__area--media.o-media
		img.o-media__img(
src='https://upload.wikimedia.org/wikipedia/commons/thumb/2/27/Salvador_Dali_NYWTS.jpg/800px-Salvador_Dali_NYWTS.jpg'
alt='Dalí in the 1960s sporting his characteristic flamboyant moustache. Photographed holding his pet ocelot'
)
	.o-grid__area.o-content
		.u-col
			span(aria-hidden='true').u-circled.u-float-right
			p Dalí was a skilled draftsman, best known for the striking and bizarre images in his surrealist work. His expansive artistic repertoire included film, sculpture, photography, theatre, and fashion, at times in collaboration with a range of artists in a variety of media. Dalí's painterly skills are often attributed to the influence of Renaissance masters. His best-known work, The Persistence of Memory, was completed in August 1931.

		.u-col
			p Dalí was highly imaginative, and also enjoyed indulging in unusual and grandiose behavior. To the dismay of those who held his work in high regard, and to the irritation of his critics, his eccentric manner and attention-grabbing public actions sometimes drew more attention than his artwork.

		.u-col
			p Dalí employed extensive symbolism in his work. For instance, the hallmark "melting watches" that first appear in The Persistence of Memory suggest Einstein's theory that time is relative and not fixed. The idea for clocks functioning symbolically in this way came to Dalí when he was staring at a runny piece of Camembert cheese on a hot August day.

		.u-col
			p Dalí frequently traveled with his pet ocelot Babou, even bringing it aboard the luxury ocean liner SS France. He was also known to avoid paying tabs at restaurants by drawing on the checks he wrote. His theory was the restaurant would never want to cash such a valuable piece of art, and he was usually correct.
		
		.u-col
			p Besides visual puns, Dalí shared in the surrealist delight in verbal puns, obscure allusions, and word games. He often spoke in a bizarre combination of French, Spanish, Catalan, and English which was sometimes amusing as well as arcane.
		
		.u-col.u-txt-right
			span(aria-hidden='true').u-circled.u-float-left
			p Salvador Dalí was born on May 11, 1904, in the town of Figueres, in the Empordà region, close to the French border in Catalonia, Spain. Dalí's older brother, who had also been named Salvador, had died of gastroenteritis nine months earlier, on 1 August 1903. His father, Salvador Rafael Aniceto Dalí Cusí was a middle-class lawyer and notary, an anti-clerical atheist and Catalan federalist, whose strict disciplinary approach was tempered by his wife, Felipa Domènech Ferrés, who encouraged her son's artistic endeavors.

		.u-col.u-txt-right
			p In August 1929, Dalí met his lifelong and primary muse and future wife Gala, born Elena Ivanovna Diakonova. She was a Russian immigrant ten years his senior, who at that time was married to surrealist poet Paul Éluard. In the same year, Dalí had important professional exhibitions and officially joined the Surrealist group in the Montparnasse quarter of Paris. His work had already been heavily influenced by surrealism for two years. The Surrealists hailed what Dalí called his paranoiac-critical method of accessing the subconscious for greater artistic creativity.
			
		.u-col.u-txt-right
			p In 1940, as World War II tore through Europe, Dalí and Gala retreated to the United States, where they lived for eight years splitting their time between New York and Monterey, California. 

		.u-col.u-txt-right
			p On the morning of 23 January 1989, while his favorite record of Tristan and Isolde played, Dalí died of heart failure at the age of 84. He is buried in the crypt below the stage of his Theatre and Museum in Figueres. The location is across the street from the church of Sant Pere, where he had his baptism, first communion, and funeral, and is only 0.45 kilometres from the house where he was born.
	footer.o-grid__area.o-footer
		p 
			small Content adapted from Wikipedia, including text and image: https://en.wikipedia.org/wiki/Salvador_Dal%C3%AD
              
            
!

CSS

              
                $dev_md_min: 35.625rem;
$dev_lg_max: 45.625rem;
$dev_lg_min: 45.688rem;

:root {
	// COLOR CSS VARIABLES
	--color_base: #85c1b1; // Mint 
	--color_mag: #ebe9e2; // Creamy
	--color_headline: #aa8740; // Gold
	--color_ink: #282724; // Black
	
	// SIZE VARIABLES	
	--magazine: 52rem;
	--img_size: 15rem;
	--img_size_circled: calc(var(--img_size) / 2);
	--gap: calc(var(--magazine) / 17.333333333333333);
	--gap_half: calc(var(--gap) / 2);
	--border: 2px;
	
	@media screen and (min-width: $dev_md_min) {
		--gap: calc(var(--magazine) / 8.666666666666667);
	}
}

// MIXINS
@mixin size($w, $h: $w) {
	width: $w;
	height: $h;
}

// LAYOUT
body {
	min-width: 20rem;
	background-color: var(--color_base);
	color: var(--color_ink);
	font-family: 'PT Sans', sans-serif;
	margin: 0;
}

figure {
	margin: 0;
}

p {
	font-size: 0.9rem;
	line-height: 1.7;
}

::selection {
	background-color: var(--color_base);
}

// UTILITY
.u-col {
	// This container allows the creation of a smoother top half circular shape in text columns, and avoids paragraph columns to break on any given breakpoint.
	display: inline-block;
}

.u-txt-right {
	@media screen and (min-width: $dev_lg_min) {
		text-align: right;	
	}
}

.u-circled {
	border-radius: 50%;
	shape-outside: circle();
	
	@media screen and (min-width: $dev_md_min) {
		@include size(calc(var(--img_size) * 1.1));
	}
	
	@media screen and (min-width: $dev_lg_min) {
		@include size(var(--img_size_circled));
	}
}

.u-float-right {
	@media screen and (min-width: $dev_md_min) {
		float: right;
	}
}

.u-float-left {
	@media screen and (min-width: $dev_lg_min) {
		float: left;
	}
}

// COMPONENTS 
.c-heading {
	font-family: 'Frank Ruhl Libre', serif;	
	font-weight: normal;
	margin: 0;
	
	&--prim {
		border-bottom: var(--border) solid var(--color_ink);
		color: var(--color_headline);
		font-size: 3.5rem;
		line-height: 0.9;
		margin-bottom: 0.7rem;
		padding-bottom: 1.5rem;
		
		@media screen and (min-width: $dev_md_min) {
			font-size: 6rem;
		}
	}
	
	&--sec {
		font-size: 1.15rem;
	}
}

// OBJECTS
.o-grid {
	max-width: var(--magazine);
	background-color: var(--color_mag);
	background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f9f7f0' fill-opacity='0.4' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
	border-left: calc((100vw - var(--magazine)) / 2) solid var(--color_ink);
	border-right: var(--border) solid var(--color_ink);
	
	display: grid;
	grid-template: auto 1fr / var(--gap) repeat(2, 1fr) var(--gap);
		
	&__area {
		grid-column: 2 / span 2;
		
		&--media {
			justify-self: center;

			@media screen and (min-width: $dev_md_min) and (max-width: $dev_lg_max) {
				justify-self: flex-end;
			}
		}
	}
}

.o-header {	
	margin-top: var(--gap_half);
	text-align: center;
}

.o-media {
	@include size(var(--img_size));
	border-radius: 50%;
	margin-top: 2rem;
	overflow: hidden;

	&__img {
		width: 100%;
	}
}

.o-content {		
	columns: 15rem;
	column-gap: calc(var(--gap) / 1.7);

	@media screen and (min-width: $dev_md_min) {
		margin-top: calc(var(--img_size_circled) * -2);
	}

	@media screen and (min-width: $dev_lg_min) {
		margin-top: calc(var(--img_size_circled) * -1);
	}
}

.o-footer {
	margin-top: 2rem;
	opacity: 0.2;

	p {
		line-height: 1.3;
		word-break: break-all;
	}
}
              
            
!

JS

              
                /* 
 * PURE CSS MAGAZINE GRID LAYOUT
 * Responsive grid layout for #CodePenChallenge Art Icons. 
 * A tribute to Salvador Dalí.
 * CSS Grid + CSS Columns + CSS Shape Outside.
 *
 * Design fully inspired by a real magazine.
 * By ilithya | 2019
 */
              
            
!
999px

Console