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

              
                <main class="cover">
  <h1 class="title">SWB</h1>
  <span class="year">1950</span>
  <p>Loremipsum</p>
  <p>Zürich</p>
  <p>Ausstellung</p>
  <div aria-hidden="true" class="top"></div>
  <div aria-hidden="true" class="bottom">
  </div>
  <div aria-hidden="true" class="divider"></div>
</main>
              
            
!

CSS

              
                $transparent: rgba(255, 255, 255, 0);
$blue: #afc7bf;
$black: #222;
$stripe-w: .35vmin;

.cover {
  border: 1em solid #fff;
  overflow: hidden;
  width: 80vmin;
  height: 115vmin;
  margin: auto;
  background-color: #e7dac9;
  display: grid; 
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr 4fr repeat(2, 1fr) 2fr 3fr;
  font-family: "Oswald", sans-serif;
  color: $black;
  

  // blue triangle
  &::before {
    content: "";
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    background-color: $blue;
    clip-path: polygon(100% 100%, 0% 0%, 100% 50%);
  }

  // blue stripes over black
  &::after {
    content: "";
    grid-column: 1 / -1;
    grid-row: 1 / 4;
    clip-path: polygon(0% 0%, 50% 100%, 100% 100%, 0% 0%);
    background-image: repeating-linear-gradient(
      0deg,
      $blue,
      $blue $stripe-w,
      $transparent $stripe-w,
      $transparent $stripe-w * 2
    );
  }
}

// solid black triangle
.top {
  grid-column: 1 / span 2;
  grid-row: 1 / span 3;
  clip-path: polygon(0% 100%, 100% 0%, 50% 100%);
  background-color: $black;
}

// gold triangle
.bottom {
  position: relative;
  grid-row: 4 / -1;
  grid-column: 1 / -1;
  background-color: #ffe669;
  mix-blend-mode: multiply;
  clip-path: polygon(0% 0%, 100% 0%, 0% 100%);

  // black stripes
  &::before {
    content: "";
    display: block;
    width: 50%;
    height: 100%;
    background-image: repeating-linear-gradient(
      0deg,
      $black,
      $black $stripe-w,
      $transparent $stripe-w,
      $transparent $stripe-w * 2
    );
    clip-path: polygon(0% 0%, 50% 0%, 0% 97%);
  }
}

// vertical line in the middle
.divider {
  z-index: 1;
  position: relative;
  width: 0.2vmin;
  grid-column: 3 / span 2;
  grid-row: 1 / -1;
  background-color: $black;

//   line going from the middle-bottom to the top right
  &::after {
    content: "";
    position: relative;
    display: block;
    height: 110%;
    width: 100%;
    bottom: 10%;
    background-color: inherit;
    transform: rotate(19.5deg);
    transform-origin: bottom left;
  }
}

.title {
  margin: 0 -2rem 0 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg) scaleX(.65);
  grid-column: 3 / span 2;
  justify-self: center;
  grid-row: 2 / span 1;
  align-self: start;
  letter-spacing: .1em;
  font-size: 12vmin;
}

.year {
  grid-column: 2 / span 1;
  grid-row: 2 / span 1;
  align-self: start;
  font-size: .7rem;
  z-index: 1;
}

p {
  z-index: 1;
  margin: 0;
  grid-row: 5 / span 1;
  align-self: center;
  font-size: 0.8rem;

  &:first-of-type {
    grid-column: 2 / span 1;
  }
  
  &:nth-of-type(2) {
    margin-left: .5em;
    grid-column: 3 / span 1;
  }
  
  &:nth-of-type(3) {
    justify-self: start;
    grid-column: 4 / span 1;
    text-align: center;
    text-transform: uppercase;
  }
}

// basic page styles

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  font-size: calc(14px * .5vmin);
}

body {
  display: flex;
  height: 100%;
  min-height: 100vh;
  background-color: lighten($blue, 10%);
}

@media screen and (min-midth: 32em), screen and (min-height: 30em) {
  body {
    margin: 1.5rem;
    min-height: 115vh;
  }
}
              
            
!

JS

              
                // view at full size: https://codepen.io/meowwwls/full/XEKzmP/

// original design: https://www.designspiration.net/save/1055701249814/

// inspired by all of Jen Simmons' amazing replications: http://labs.jensimmons.com/


              
            
!
999px

Console