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

              
                <!-- NOTE: it's doesn't work on IE/Edge due to lack of clip-path support -->
<div class="container">
  <div class="receipt">
    <h2 class="receipt__title">Thank you.</h2>
    <p class="receipt__subtitle">Your order is on its way. Here is your receipt:</p>
    <ul class="receipt__lines">
      <li class="receipt__line">
        <span class="receipt__line__item">Octocat Mug</span>
        <span class="receipt__line__price">11,99 €</span>  
      </li>
      <li class="receipt__line">
        <span class="receipt__line__item">ES6 stickers (x5)</span>
        <span class="receipt__line__price">1,99 €</span>  
      </li>
      <li class="receipt__line">
        <span class="receipt__line__item">Node modules (+Infinity)</span>
        <span class="receipt__line__price">8 403,67 €</span>  
      </li>
    </ul>
    <p class="receipt__total">
      <span class="receipt__total__item">Total</span>
      <span class="receipt__total__price">8 417,65 €</span>
    </p>
    <p class="receipt__back">
      <a href="#">Return to shop</a>
    </p>
  </div>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400|Work+Sans:300,500');

// More rhythm = less tips
// Depth = tips height
@mixin ripped-effect($rhythm, $depth) {
  $tip: calc(100% - #{$depth});
  $ripped: '100% 0, 100% #{$tip}, ';
  $end: 100 - $rhythm;
  $isPrevTip: true;

  @for $i from $end through 1 {
    @if $i % $rhythm == 0 {
      @if $isPrevTip {
        $ripped: #{$ripped + $i + '% 100%, '};
        $isPrevTip: false;
      } @else {
        $ripped: #{$ripped + $i + '% #{$tip}, '};
        $isPrevTip: true;
      }
    }
  }

  $ripped: #{$ripped + '0 #{$tip}, 0 0'};

  clip-path: polygon($ripped);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: #525252;
  font-family: 'Work Sans', sans-serif;
  font-weight: 300;
  line-height: 1.25;
  background: linear-gradient(to bottom, #00b09b, #96c93d);
}

a {
  color: #5c7b25;
  text-decoration-skip: ink;
}

.receipt {
  position: relative;
  flex: none;
  padding: 30px 0;
  background: #fff;
  @include ripped-effect(2, 6px);
  
  &__title {
    margin-bottom: 15px;
    padding: 0 30px;
    font-family: 'Work Sans', sans-serif;
    font-weight: 500;
    font-size: 40px;
    color: #00b09b;
  }
  
  &__subtitle {
    padding: 0 30px;
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: 18px;
  }
  
  &__lines {
    margin-top: 50px;
    padding: 30px;
    border-top: 1px dashed #dce2d6;
  }
  
  &__line {
    display: flex;
    margin: 20px 0;
    justify-content: space-between;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 18px;
    
    &__item {
      font-weight: 300;
    }
    
    &__price {
      font-weight: 400;
    }
  }
  
  &__total {
    display: flex;
    margin: 20px 0;
    padding: 30px;
    justify-content: space-between;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 24px;
    background-color: #eff7e8;
    
    &__item,
    &__price {
      font-weight: 400;
    }
  }
  
  &__back {
    text-align: center;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console