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

Packages

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.

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

              
                <section>
	<div class="container">
		<h1>Media Slat Pattern</h1>
	</div>
	
	<ul>
		<li>
		<!-- Media Slat -->
		<article class="media media--slat">
			<div class="media__item">
				<img
				src="https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-01_lrg.jpg"
				srcset="https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-01_xlrg.jpg 1680w,
				https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-01_lrg.jpg 1280w,
				https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-01_med.jpg 1024w,
				https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-01_sml.jpg 720w,
				https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-01_xsml.jpg 360w"
				sizes="100vw"
				alt="Tape Recorder">
			</div>
			<div class="media__body">
				<h1 class="media__body-title">Media Slat</h1>
				<dl class="media__body-list">
					<dt class="media__body-list-title">Aperture</dt>
					<dd class="media__body-list-data">4.970854</dd>
					<dt class="media__body-list-title">ISO</dt>
					<dd class="media__body-list-data">200</dd>
					<dt class="media__body-list-title">Exposure Time</dt>
					<dd class="media__body-list-data">0.05</dd>
				</dl>
			</div>
		</article>
		<!-- Media Slat -->
		</li>
		
		<li>
		<!-- Media Slat -->
		<article class="media media--slat">
			<div class="media__item">
				<img
				src="https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-02_lrg.jpg"
				srcset="https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-02_xlrg.jpg 1680w,
				https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-02_lrg.jpg 1280w,
				https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-02_med.jpg 1024w,
				https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-02_sml.jpg 720w,
				https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-02_xsml.jpg 360w"
				sizes="100vw"
				alt="Amplifier">
			</div>
			<div class="media__body">
				<h1 class="media__body-title">Media Slat</h1>
				<dl class="media__body-list">
					<dt class="media__body-list-title">Aperture</dt>
					<dd class="media__body-list-data">4.970854</dd>
					<dt class="media__body-list-title">ISO</dt>
					<dd class="media__body-list-data">200</dd>
					<dt class="media__body-list-title">Exposure Time</dt>
					<dd class="media__body-list-data">0.05</dd>
				</dl>
			</div>
		</article>
		<!-- Media Slat -->
		</li>
		
		<li>
		<!-- Media Slat -->
		<article class="media media--slat">
			<div class="media__item">
				<img
				src="https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-01_lrg.jpg"
				srcset="https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-03_xlrg.jpg 1680w,
				https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-03_lrg.jpg 1280w,
				https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-03_med.jpg 1024w,
				https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-03_sml.jpg 720w,
				https://public-619e3.firebaseapp.com/Extensible-Media-Component/img-03_xsml.jpg 360w"
				sizes="100vw"
				alt="Guitar">
			</div>
			<div class="media__body media__body--centered">
				<h1 class="media__body-title">Media Slat</h1>
				<dl class="media__body-list">
					<dt class="media__body-list-title">Aperture</dt>
					<dd class="media__body-list-data">4.970854</dd>
					<dt class="media__body-list-title">ISO</dt>
					<dd class="media__body-list-data">200</dd>
					<dt class="media__body-list-title">Exposure Time</dt>
					<dd class="media__body-list-data">0.05</dd>
				</dl>
			</div>
		</article>
		<!-- Media Slat -->
		</li>
	</ul>

</section>

<footer role="contentinfo">
	<div class="container">
		Photography by <a href="https://unsplash.com/@markusspiske">Markus Spiske</a>
	</div>
</footer>
              
            
!

CSS

              
                /**
 * Custom Web Fonts
 */

@import url(//fonts.googleapis.com/css?family=Open+Sans:700,400);


/**
 * Variables
 */

// Breakpoints
$breakpoints: (
  small: 50em,
  medium: 64em,
  large: 80em,
  xlarge: 125em
);

// Media Quries
$small: "(min-width: 30em)";
$medium: "(min-width: 64em)";
$large: "(min-width: 80em)";
$xlarge: "(min-width: 125em)";

// Spacing
$base-spacing: 1em;

// Typography
$base-font-size: 1em;
$base-line-height: 1.5;
$header-line-height: 1.25;

// Colors Vars
$color-gold: #B5A54A;
$color-red: #FF0000;
$color-off-white: #EEE9E4;

// Colors Base
$base-accent-color: $color-gold;
$secondary-accent-color: invert($base-accent-color);
$base-font-color: desaturate(darken($base-accent-color, 30%), 50%);
$base-background-color: $color-off-white;
$base-alert-color: mix($base-accent-color, $color-red, 50%);

// Transition Settings
$base-transition-duration: .3s;
$base-transition-timing: ease-in-out;

// Border Radius
$base-border-radius: 0.2em;

// Borders
$base-border: 1px solid darken($base-background-color, 20%);

// Shadow
$base-box-shadow: 0 2px 2px 0 rgba(black, 0.2);
$hover-box-shadow: 0 2px 2px 0 rgba(black, 0.4);


/**
 * Base Styles
 */
*,
*:before,
*:after {
  box-sizing: border-box; /* 1 */
}

body {
  background-color: $base-background-color;
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  font-size: $base-font-size;
  color: $base-font-color;
  line-height: $base-line-height;
}

a {
  color: $base-accent-color;
  transition: color $base-transition-duration $base-transition-timing;
  text-decoration: none;
}

img {
  max-width: 100%;
}

p {
  margin: 0 0 $base-spacing;
}

hr {
	display: block;
	height: 1px;
	border: 0;
	border-top: $base-border;
	margin: $base-spacing*2 0;
	padding: 0;
}

@function headings($from:1, $to:6) {
    @if $from == $to {
        @return 'h#{$from}';
    } @else {
        @return 'h#{$from},' + headings($from+1, $to);
    }
}

#{headings(1,6)} {
	margin: 0 0 $base-spacing;
  font-weight: 700;
	line-height: $header-line-height;
}

h1 {
	font-size: $base-font-size*2;
}


/**
 * Global Styles
 */

.container {
  margin: 0 auto;
  padding: $base-spacing;
  max-width: map-get($breakpoints, medium);
}

[role="contentinfo"] {
  padding: $base-spacing*2 0;
}


/**
 * Media
 */
.media {
	display: flex;
	flex-wrap: wrap;
	border-bottom: $base-border;

	/* Modifers */
	&--slat {
		position: relative;
		width: 100%;
		overflow: hidden;
		background-color: white;
		
		@media #{$small} {
			flex-wrap: nowrap;
			height: 200px;
		}
		
		@media #{$medium} {
			height: 250px;
		}

		@media #{$large} {
			height: 300px;
		}

		@media #{$xlarge} {
			height: 400px;
		}
	}
}

.media__item {
	margin: 0 0 $base-spacing;

	img {
		display: block;
	}
	
	/* Block Modifers */
	.media--slat & {
		@media #{$small} {
			margin: 0;
			position: absolute;
			z-index: 1;
			top: 0;
			right: 0;
			width: 60%;
			height: 100%;
			overflow: hidden;
		}
	}
}

.media__body {
	width: 100%;
	
	/* Block Modifers */
	.media--slat & {
		padding: $base-spacing $base-spacing 0;
		
		@media #{$small} {
			position: absolute;
			z-index: 2;
			top: 50%;
			transform: translate( 0, -50% );
			max-width: (map-get($breakpoints, medium) - $base-spacing )/2;
			align-self: center;
		}

		@media #{$large} {
			left: 50%;
			transform: translate( -(map-get($breakpoints, medium) - $base-spacing )/2, -50%);
			padding-left: $base-spacing/2;
		}
	}
}

.media__body-title {
	margin: 0 0 $base-spacing/2;
	font-size: $base-font-size;
	color: $base-accent-color;
}

.media__body-list {
	font-size: 0.825em;
}

.media__body-list-title {
	margin: 0 $base-spacing/2 0 0;
	font-weight: bold;
}

.media__body-list-data {
	margin: 0 $base-spacing $base-spacing 0;
}
              
            
!

JS

              
                
              
            
!
999px

Console