Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <!-- SVG Symbols - place this right after <body> tag-->
<svg xmlns="http://www.w3.org/2000/svg" style="display: none">
  <!-- icon menu   -->
  <symbol id="icon-menu" viewBox="0 0 32 32" aria-labelledby="menu-title menu-desc">
    <title id="menu-title">main menu</title>
    <desc id="menu-desc">click to reveal main navigation items</desc>
    <path d="M4 6.667h24q0.552 0 0.943 0.391t0.391 0.943-0.391 0.943-0.943 0.391h-24q-0.552 0-0.943-0.391t-0.391-0.943 0.391-0.943 0.943-0.391zM4 22.667h24q0.552 0 0.943 0.391t0.391 0.943-0.391 0.943-0.943 0.391h-24q-0.552 0-0.943-0.391t-0.391-0.943 0.391-0.943 0.943-0.391zM4 14.667h24q0.552 0 0.943 0.391t0.391 0.943-0.391 0.943-0.943 0.391h-24q-0.552 0-0.943-0.391t-0.391-0.943 0.391-0.943 0.943-0.391z"></path>
  </symbol>
  <!-- icon plus   -->
  <symbol id="icon-plus" viewBox="0 0 32 32" aria-labelledby="plus-title plus-desc">
    <title id="plus-title">plus</title>
    <desc id="plus-desc">plus symbol</desc>
    <path d="M16 2.667q0.552 0 0.943 0.391t0.391 0.943v10.667h10.667q0.552 0 0.943 0.391t0.391 0.943-0.391 0.943-0.943 0.391h-10.667v10.667q0 0.552-0.391 0.943t-0.943 0.391-0.943-0.391-0.391-0.943v-10.667h-10.667q-0.552 0-0.943-0.391t-0.391-0.943 0.391-0.943 0.943-0.391h10.667v-10.667q0-0.552 0.391-0.943t0.943-0.391z"></path>
  </symbol>
  <!-- icon arrow   -->
  <symbol id="icon-arrow" viewBox="0 0 32 32" aria-labelledby="arrow-title arrow-desc">
    <title id="arrow-title">arrow</title>
    <desc id="arrow-desc">arrow</desc>
    <path d="M18.667 5.333q0.563 0 0.948 0.385l9.333 9.333q0.385 0.385 0.385 0.948t-0.385 0.948l-9.333 9.333q-0.385 0.385-0.948 0.385-0.573 0-0.953-0.38t-0.38-0.953q0-0.563 0.385-0.948l7.063-7.052h-20.781q-0.552 0-0.943-0.391t-0.391-0.943 0.391-0.943 0.943-0.391h20.781l-7.063-7.052q-0.385-0.385-0.385-0.948 0-0.573 0.38-0.953t0.953-0.38z"></path>
  </symbol>
</svg>

<section>
  <article class="card">
    <picture class="media">
      <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/97621/jules-d-983253-unsplash.jpg" alt="">
    </picture>
    <a href="//www.smashingmagazine.com/2016/11/css-grids-flexbox-box-alignment-new-layout-standard/" class="link">Full Article
      <svg class="icon"><use xlink:href="#icon-arrow"></use></svg>
    </a>
    <h2 class="title">Web layout is <del>hard</del> <ins>fun</ins>.</h2>
    <div class="copy">
      <p class="heading">With CSS grid now available in all popular browsers it’s possible to reliably define the rows and columns that make up any kind of grid.</p> 
      <p class="text">The reason it is so hard is that the layout methods we’ve relied on ever since using CSS for layout became possible were not really designed for complex layout. While we were able to achieve quite a lot in a fixed-width world with hacks such as faux columns, these methods fell apart with responsive design.</p>         
    </div>
  </article>
</>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Questrial|Source+Serif+Pro:400,700');

:root {
  // sizing scale
  --scale-tiny: calc(1vw + .125rem);
  --scale-sm: calc(1vw + .25rem);
  --scale-md: calc(1vw + .5rem);
  --scale-lg: calc(1vw + .875rem);
  --scale-xl: calc(1vw + 1.25rem);
  
  --font-Questrial: 'Questrial', sans-serif;
  --font-Source-Serif-Pro: 'Source Serif Pro', serif;
  
  //font-size: calc( 1rem + (40 - 18) * ( (100vw - 400px) / ( 1600 - 400)));
  font-size: var(--scale-lg);
}

body {
  display: flex;
  font-family: sans-serif;
  //min-height: 100vh;
}

h1, h2, h3, h4, h5 , h6,
[class*='heading'] {
  font-family: var(--font-Source-Serif-Pro);
}

.heading {
  font-size: calc(1vw + .9rem);
  line-height: var(--scale-xl);
}

img {
  max-width: 100%;
}

.icon {
  display: inline-block;
  fill: currentColor;
  height: 1em;
  width: 1em;
  vertical-align: middle;
  position: relative;
  top: -.0625em;
  margin-right: .25rem;
  margin-left: .25rem;
  text-align: center;
  stroke-width: 0;
}

button {
  border-radius: .21rem;
}

ul {
  list-style-type: none;
  a {
    text-decoration: none;
  }
}

p {
  font-size: .75rem;
  line-height: var(--scale-lg);
  max-width: 50ch;
}

.card {
  //color: #fafafa;
  display: grid;
  //align-items: center;
  flex: 1;
  grid-gap: var(--scale-lg);
  grid-template-columns: 2rem repeat(12, auto) 2rem;
  
  > * {
  
  }
  
  > *:not(.media) {
    z-index: 1;
  }
  
  @media (min-width: 65em) {
    // grid-column-gap: var(--scale-lg);
    grid-row-gap: 0;
  }
}

.link {
  display: flex;
  align-items: center;
  align-self: center;
  justify-self: start;
  background: rgba(rebeccapurple, .0);
  box-shadow: inset 0 0 0 .1rem;
  color: currentcolor;
  font-family: var(--font-Questrial);
  font-size: .65rem;
  grid-column: 2 / 14;
  grid-row: 4 / 4;
  letter-spacing: .1em;
  padding: .65rem .7rem .65rem 1rem;
  text-decoration: none;
  text-transform: uppercase;
  transition: .4s ease;
  
  svg {
    fill: #555;
    margin-left: .5rem;
    transition: .3s ease;
  }
  
  &:hover,
  &:focus {
    background: rgba(rebeccapurple, 1);
    box-shadow: inset 0 0 0 4px white;
    color: white;
    
    svg {
      fill: white;
      transform: translateX(.35rem) scale(1.1);
    }
  }
  
  @media (min-width: 44em) {
    //justify-self: end;
    grid-column: 13 / 14;
    grid-row: 3 / 4;
  }
  
  @media (min-width: 65em) {    
    justify-self: end;
    grid-column: 12 / 14;
    grid-row: 4 / 5;
  }
}

.title {
  align-self: start;
  font-size: calc(1vw + 2.5rem);
  grid-column: 2 / 14;
  grid-row: 2 / 2;
  margin-bottom: 2rem;
  //max-width: 15ch;
  
  @media (min-width: 44em) {
    grid-column: 2 / 12;
    grid-row: 3 / 3;
    margin-bottom: 0;
  }
  
  @media (min-width: 65em) {
    grid-column: 2 / 8;
    grid-row: 4 / 5;
  }
}

.media {
  background: linear-gradient(225deg, turquoise, darkmagenta);
  display: flex;
  grid-column: 1 / end;
  grid-row: 1 / 8;
  overflow: hidden;
  
  img {
    line-height: 0;
    mix-blend-mode: color-dodge;    
    height: 100vh;
    object-fit: cover;
    opacity: .2;
    width: 100vw;
  }
}

.copy {
  grid-column: 2 / 14;
  grid-row: 3 / 3;
  line-height: calc(1vw + 1.1em);
  margin-bottom: 0;
  
  .heading {    
    // background: rgba(black, .125);
    // padding: var(--scale-md);
    
    &:first-letter {
      font-size: 3rem;
      letter-spacing: -.075em;
      margin-left: -.75rem;
      vertical-align: baseline;
    }
  }
  
  .text {
    background: transparent;
    font-style: italic;
    line-height: 1.45;
    //max-width: 40ch;
    padding: 0;
  }
  
  @media (min-width: 44em) {
    grid-column: 4 / 14;
    grid-row: 5 / 5;
  }
  
  @media (min-width: 65em) {
    align-self: end;
    grid-column: 9 / 14;
    grid-row: 3 / 3;
  }
}
              
            
!

JS

              
                // I made this before the challenge date but I'm going to tag it anyway. 
              
            
!
999px

Console