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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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

              
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@100;200;300;400;500;600;700;800&family=Inter:wght@100;200;300;400;500;600;700;800&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto+Slab:wght@100;200;300;400;500;600;700;800;900&display=swap">

<main>
  <h1 class="title">1Feed</h1>
  <div class="feed">
    <div class="entity">
      <h2 class="entity-name"><img class="entity-icon" src="https://unavatar.now.sh/twitter/elonmusk"> Elon Musk</h2>
      <div class="entity-feed">
        <a class="entity-feed-item" href="#">I'm sending an aeroplane to mars: a thread</a>
        <div class="entity-feed-separator"></div>
        <a class="entity-feed-item" href="#">My new baby is going to be called ZH5F49B6G1NJ4S</a>
      </div>
    </div>
    <div class="entity">
      <h2 class="entity-name"><img class="entity-icon" src="https://unavatar.now.sh/twitter/naval"> Naval Ravikant</h2>
      <div class="entity-feed">
        <a class="entity-feed-item" href="#">How to get rich (without getting lucky)</a>
        <div class="entity-feed-separator"></div>
        <a class="entity-feed-item" href="#">Wealth is immaterial, the real wealth is the friends we made along the way</a>
      </div>
    </div>
    <div class="entity">
      <h2 class="entity-name"><img class="entity-icon" src="https://unavatar.now.sh/twitter/firefox"> Firefox Release News</h2>
      <div class="entity-feed">
        <a class="entity-feed-item" href="#">New in Firefox 79</a>
        <div class="entity-feed-separator"></div>
        <a class="entity-feed-item" href="#">New in Firefox 78</a>
        <div class="entity-feed-separator"></div>
        <a class="entity-feed-item" href="#">New in Firefox 77</a>
        <div class="entity-feed-separator"></div>
        <a class="entity-feed-item" href="#">New in Firefox 76</a>
        <div class="entity-feed-separator"></div>
        <a class="entity-feed-item" href="#">New in Firefox 75</a>
        <div class="entity-feed-separator"></div>
        <a class="entity-feed-item" href="#">New in Firefox 74</a>
      </div>
    </div>
    <div class="entity">
      <h2 class="entity-name"><img class="entity-icon" src="https://unavatar.now.sh/twitter/matteing"> Sergio Mattei</h2>
      <div class="entity-feed">
        <a class="entity-feed-item" href="#">Introducing Makerlog: A platform to help you stay more productive as a maker</a>
        <div class="entity-feed-separator"></div>
        <a class="entity-feed-item" href="#">Here's a preview of the new design for logging tasks!</a>
      </div>
    </div>
  </div>
</main>
              
            
!

CSS

              
                $multiline-breakpoint: 500px;

* {
  box-sizing: border-box;
  // letter-spacing: -0.025em;
  letter-spacing: -0.01em;
  user-select: none;
}

body {
  margin: 0;
  // font-family: system-ui, Sora;
  font-family: -apple-system, BlinkMacSystemFont, Inter, sans-serif;
  background: hsl(220, 12%, 95%);
  color: hsl(220, 12%, 25%);
}

.title {
  font-size: 2em;
  margin: 1rem 0;
}

main {
  width: 700px;
  max-width: 100%;
  margin: auto;
  padding: 1rem;
  // border: 1px solid red;
}

.feed {
  .entity {
    // background: hsl(220, 12%, 97%);
    // border: 1px solid hsl(220, 12%, 93%);
    // padding: 10px;
    margin-bottom: 1rem;
    border-radius: 10px;

    &-name {
      display: flex;
      align-items: center;
      margin-top: 0;
      margin-bottom: 0.5rem;
      font-size: 0.7em;
      font-weight: 700;
      text-transform: uppercase;
      font-family: -apple-system, Inter, sans-serif;
      font-weight: 800;

      &:after {
        content: "";
        flex-grow: 1;
        background: hsl(220, 12%, 90%);
        height: 3px;
        margin-left: 1em;
        border-radius: 10px;
      }
    }

    &-icon {
      height: 1.5em;
      width: 1.5em;
      border-radius: 50%;
      margin-right: 5px;
      // display: none;
    }

    &-feed {
      overflow: hidden;
      display: flex;
      position: relative;
      @media screen and (max-width: $multiline-breakpoint) {
        flex-direction: column;
      }

      &:after {
        content: "";
        width: 300px;
        background: linear-gradient(
          90deg,
          hsla(220, 12%, 95%, 0),
          hsl(220, 12%, 95%)
        );
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        display: none;
      }

      &-separator {
        flex-shrink: 0;
        margin: 0 0.5em;
        &:before {
          content: "•";
        }
        @media screen and (max-width: $multiline-breakpoint) {
          display: none;
        }
      }

      &-item {
        flex-shrink: 0;
        color: hsl(215, 100%, 45%);
        font-weight: 500;
        text-decoration: none;
        @media screen and (max-width: $multiline-breakpoint) {
          white-space: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;
          margin-bottom: 0.25rem;

          // Hide all entries except the first three
          // Child indices go up to 5 because of the 2 separator elements
          &:not(:nth-child(1)):not(:nth-child(2)):not(:nth-child(3)):not(:nth-child(4)):not(:nth-child(5)) {
            display: none;
          }
        }
      }
    }
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console