cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              .text-block
  - (1..5).each do |i|
    %h3 .line-clamp--#{i}
    %p{:class => "line-clamp line-clamp--#{i}"} 
      Recognize that the very molecules that make up your body, the atoms that construct the molecules, are traceable to the crucibles that were once the centers of high mass stars that exploded their chemically rich guts into the galaxy, enriching pristine gas clouds with the chemistry of life. So that we are all connected to each other biologically, to the earth chemically and to the rest of the universe atomically. That’s kinda cool! That makes me smile and I actually feel quite large at the end of that. It’s not that we are better than the universe, we are part of the universe. We are in the universe and the universe is in us.
            
          
!
            
              .line-clamp {
  display: block;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-height: 1.5;
  overflow: hidden;
  padding: 0 !important;
  position: relative;
  text-overflow: ellipsis;
  &:after {
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 75%);
    content: "";
    display: block;
    position: absolute;
    right: 0;
    text-align: right;
    width: 25%;
    height: 1rem * 1.5;
  }
}

@supports (-webkit-line-clamp: 1) {
  .line-clamp:after {
    display: none !important;
  }
}

@mixin line-clamp($lines) {
  .line-clamp--#{$lines} {
    -webkit-line-clamp: $lines;
    height: 1rem * 1.5 * $lines;
    &:after {
      top: 1rem * 1.5 * ($lines - 1);
    }
  }
}

@include line-clamp(1);
@include line-clamp(2);
@include line-clamp(3);
@include line-clamp(4);
@include line-clamp(5);

// Body styling
body {
  padding: 2rem 3rem;
  text-align: left;
}

.text-block {
  margin: 0 auto;
  max-width: 55ch;
}

h3 {
  margin-top: 2rem;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console