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

              
                <div class="content-container">
  <figure class="pot">
    <div class="contents" aria-hidden="true"></div>
  </figure>
<h1>First, coffee</h1>       
<p>Our first date was Sunday morning coffee at the Starbucks on Thayer Street. It wasn’t the coffee that sparked the magic per se, but sitting, lingering over a cup, over laughter, over a story—16 years later that magic is still strong. Over time our coffee beans have changed—we’ve been getting them from Borealis now for a while—but the morning routine largely hasn’t. I'm up around 5:15 or 5:30, shower and get ready. Grind the beans, set up the coffee maker, turn on the timer, wake up the pups. They’re older now, so it takes some bribery. Our walk usually goes from 6 to 7:15 or so. It’s a little longer now that Tristan has slowed down a bit. Coffee brews while I’m walking, ready by the time I get back. Feed Tristan and Tillie, and then pour two cups (one black, one with almond milk). We have a collection of diner mugs from places we’ve been or just like, and I always try and pick a matching set. Upstairs, give Ellen her cup, and sit while she finishes getting ready. <em>First, coffee</em></p>
</div>

              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap');


:root {
  --coffeepot: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/57225/coffee_pot.png);
  --coffeepot-polygon: polygon(48.14% 12.00%, 29.27% 18.21%, 29.47% 20.94%, 53.72% 25.02%, 30.48% 25.44%, 26.63% 42.54%, 19.47% 27.61%, 14.68% 26.59%, 7.85% 30.26%, 12.36% 34.33%, 14.72% 38.75%, 15.79% 44.32%, 16.78% 51.65%, 16.81% 59.44%, 19.01% 65.11%, 22.23% 66.6%, 21.17% 88.32%, 166px 94.95%, 76.07% 95.21%, 77.25% 77.44%, 80.76% 73.85%, 80.15% 69.36%, 89% 55.31%, 93.08% 45.82%, 93.98% 37.76%, 90.89% 32.05%, 85.62% 26.85%, 78.41% 27.24%, 72.83% 25.69%, 64.4% 18.07%, 60.77% 14.75%, 62.03% 10.24%, 59% 30px, 49.58% 5.45%);
  /* responsive font size and width */
  --base-font-size: 1;
  --content-width: 40rem;
}
  @media screen and (min-width: 42rem) {
    :root {
      --base-font-size: 1.25;
      --content-width: 42rem;
    }
  }


*, *:before, *:after {
  box-sizing: border-box; 
}


body {
  background: #fdfdff;
  padding-top: 2em;
  color: #393939;
  font-family: 'Work Sans', sans-serif;
  font-weight: 450;
}

.content-container {
  max-width: 96vw;
  margin: 2em auto;
  position: relative;
}

h1 {
  color: #1a1010;
  font-size: calc( var(--base-font-size) * 3.25em );
  font-weight: 900;
  line-height: 1.2;
  margin: 0 auto;
  max-width: var(--content-width);
  padding: 0;
}

p {
  font-size: calc( var(--base-font-size) * 1em );
  margin: 0 auto;
  line-height: 1.5;
  max-width: var(--content-width);
}

/* any time a paragraph follows another element, add margin above */  
* + p {
  margin-top: 1em;
}

.pot {
  background: var(--coffeepot);
  background-size: 94%;
  background-position: 3%;
  background-repeat: no-repeat;
  width: 40vw;
  height: 50vw;
  float: left;
  margin: 0;
  padding: 0;
  position: relative;
  shape-margin: 1rem;
  shape-outside: var(--coffeepot-polygon);
  z-index: -1;
}
.pot .contents {
  color: rgba(205,225,235,.25);
  font-size: 4.5em;
  font-weight: 650;
  height: 100%;
  letter-spacing: -.35em;
  line-height: 0.5;
  width: 100%;
  word-break: break-word;
  clip-path: var(--coffeepot-polygon);
}

              
            
!

JS

              
                document.querySelector('.pot .contents').innerText = document.querySelector('.content-container').innerText;
              
            
!
999px

Console