123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="wrapper">
  <article class="price-block">
    <header class="price-block__header">
      <h1 class="price-block__title">Basic Plan</h1>
      <span class="price-block__cost">Free</span>
      <span class="price-block__trigger">▾</span>
    </header>
    <div class="price-block__info">
      <button class="price-block__btn">Sign Up</button>
      <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
    </div>
  </article>

  <article class="price-block">
    <header class="price-block__header">
      <h1 class="price-block__title">Standard Plan</h1>
      <span class="price-block__cost">$10 per month</span>
      <span class="price-block__trigger">▾</span>
    </header>
    <div class="price-block__info">
      <button class="price-block__btn">Sign Up</button>
      <p>They're pretty neat huh?</p>
    </div>
  </article>

  <article class="price-block">
    <header class="price-block__header">
      <h1 class="price-block__title">Premium Plan</h1>
      <span class="price-block__cost">$20 per month</span>
      <span class="price-block__trigger">▾</span>
    </header>
    <div class="price-block__info">
      <button class="price-block__btn">Sign Up</button>
      <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
      <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
    </div>
  </article>

  <article class="price-block">
    <header class="price-block__header">
      <h1 class="price-block__title">Advanced Plan</h1>
      <span class="price-block__cost">First Born Child</span>
      <span class="price-block__trigger">▾</span>
    </header>
    <div class="price-block__info">
      <button class="price-block__btn">Sign Up</button>
      <p>It's only your first born child! What are you waiting for! No biggie right? Signup now!</p>
    </div>
  </article>
</div>
            
          
!
            
              @import "compass/css3";

// ============================================================
// $Price Block Variables
// ============================================================

$width: 25%;
$viewport-increment: 0.1px;
$price-block-large: 740px;
$collapsed-price-block: $price-block-large - $viewport-increment;
$price-block-bg: #0D3640;
$price-block-color: #EFEFEF;


// ============================================================
// $Globals
// ============================================================

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

html {
  font: normal 100%/1.5 sans-serif;
  word-wrap: break-word;
}

html,
body {
  height: 100%;
}

:before,
:after {
  content: "";
  height: 100%;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: -1;
}


// ============================================================
// $Container
// ============================================================

.wrapper {
  overflow: auto;
  height: 100%;
  position: relative;
}


// ============================================================
// $Price Block
// ============================================================

.price-block {
  padding: 0 1rem; // 0 (16px/16px)
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  color: $price-block-color;

  @media screen and (max-width: $collapsed-price-block) {
    position: relative;
  }

  @media screen and (min-width: $price-block-large) {
    float: left;
  }

  &:nth-child(1) {
    background: $price-block-bg;
    @media screen and (min-width: $price-block-large) {
      width: $width;
    }

    &:before {
      @media screen and (min-width: $price-block-large) {
        left: 0;
        width: $width;
        background: $price-block-bg;
      }
    }
  }

  &:nth-child(2) {
    background: scale-lightness($price-block-bg, 5%);
    @media screen and (min-width: $price-block-large) {
      width: $width;
    }

    &:before {
      @media screen and (min-width: $price-block-large) {
        left: $width;
        width: $width;
        background: scale-lightness($price-block-bg, 5%);
      }
    }
  }

  &:nth-child(3) {
    background: scale-lightness($price-block-bg,10%);

    @media screen and (min-width: $price-block-large) {
      width: $width;
    }

    &:before {
      @media screen and (min-width: $price-block-large) {
        left: $width * 2;
        width: $width;
        background: scale-lightness($price-block-bg,10%);
      }
    }
  }

  &:nth-child(4) {
    background: scale-lightness($price-block-bg, 15%);
    @media screen and (min-width: $price-block-large) {
      width: $width;
    }

    &:before {
      @media screen and (min-width: $price-block-large) {
        left: $width * 3;
        width: $width;
        background: scale-lightness($price-block-bg, 15%);
      }
    }
  }
}


// ============================================================
// $Price Block Header
// ============================================================

.price-block__title {
  margin-top: 0;
  margin-bottom: 1.25rem; // 20px / 16px
  padding: 1.25rem 0 0; // (20px / 16px) 0 0
  font-size: 1.25em; // 20px / 16px
  font-weight: 700;
  line-height: 1;
}

.price-block__cost {
  font-weight: 300;
  font-style: italic;
}


// ============================================================
// $Price Block Button
// ============================================================

.price-block__btn {
  appearance: none;
  border: none;
  margin: 0.625rem 0 0.3125rem; // (10px / 16px) 0 0 (5px / 16px)
  width: 100%;
  background: scale-lightness($price-block-bg, -25%);
  color: #EFEFEF;
  
  &:hover {
    background: scale-lightness($price-block-bg, -15%);
  }
}


// ============================================================
// $Price Block Info
// ============================================================

.price-block__info {
  padding: 0 0 1.25rem; // 0 0 (20px / 16px)
  @media screen and (max-width: $collapsed-price-block) {
    height: 0;
    visibility: hidden;
  }

  &.opened {
    @media screen and (max-width: $collapsed-price-block) {
      height: auto;
      visibility: visible;
    }
  }
}


// ============================================================
// $Price Block Trigger
// ============================================================

.price-block__trigger {
  @media screen and (max-width: $collapsed-price-block) {
    position: absolute;
    top: 5px;
    right: 20px;
    font-size: 1.5625em; // 25px / 16px
    font-style: normal;

    &:hover {
      cursor: pointer;
    }
  }

  @media screen and (min-width: $price-block-large) {
    display: none;
  }
}
            
          
!
            
              function priceToggle(e) {
  e.preventDefault();
  $(this).parent().next().toggleClass('opened');
}

$('.price-block__trigger').on('click', priceToggle);
$('.price-block__trigger').on('touchstart', priceToggle);
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console