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

              
                <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">
        <span>Elon Musk</span>
        <span class="entity-date">20m ago</span>
        <i class="entity-source-icon fab fa-twitter"></i>
      </h2>
      <div class="entity-feed">
        <div class="entity-feed-items-wrapper">
          <a class="entity-feed-item" href="#">I&rsquo;m sending an aeroplane to mars &mdash; 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>
    <div class="entity">
      <h2 class="entity-name">
        <img class="entity-icon" src="https://unavatar.now.sh/twitter/naval">
        <span>Naval Ravikant</span>
        <span class="entity-date">3h ago</span>
        <i class="entity-source-icon fab fa-twitter"></i>
      </h2>
      <div class="entity-feed">
        <div class="entity-feed-items-wrapper">
          <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>
    <div class="entity">
      <h2 class="entity-name">
        <img class="entity-icon" src="https://unavatar.now.sh/twitter/firefox">
        <span>Firefox Release News</span>
        <span class="entity-date">2d ago</span>
        <i class="entity-source-icon fa fa-rss"></i>
      </h2>
      <div class="entity-feed">
        <div class="entity-feed-items-wrapper">
          <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>
    <div class="entity">
      <h2 class="entity-name">
        <img class="entity-icon" src="https://unavatar.now.sh/twitter/matteing"> <span>Sergio Mattei</span>
        <span class="entity-date">4d ago</span>
        <i class="entity-source-icon fab fa-twitter"></i>
        <i class="entity-source-icon fa fa-rss"></i>
      </h2>
      <div class="entity-feed">
        <div class="entity-feed-items-wrapper">
          <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>
  </div>
</main>
              
            
!

CSS

              
                * {
  box-sizing: border-box;
  user-select: none;
}

body {
  margin: 0;
  user-select: auto;
  font-family: Inter, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  @supports (font-variation-settings: normal) {
    font-family: "Inter var", -apple-system, BlinkMacSystemFont, Roboto,
      sans-serif;
  }
}

main {
  padding: 1rem;

  .title {
    margin-top: 0;
    // font-family: "Playfair Display", serif;
    // font-family: "Libre Baskerville", serif;
    // font-family: Sora;
    font-weight: 600;
  }

  .entity {
    $entity-card-padding-vertical: 0.75rem;
    $entity-card-padding-horizontal: 0.75rem;

    &-name {
      margin: 0;
      font-weight: 500;
      font-size: 0.8rem;
      display: flex;
      align-items: center;
      padding: 0 $entity-card-padding-horizontal;
      margin-bottom: 0.5rem;
      opacity: 0.8;
      width: 100%;
    }
    &-icon {
      width: 1.2em;
      height: 1.2em;
      margin-right: 0.25em;
      border-radius: 50%;
    }
    &-date {
      opacity: 0.4;
      margin-right: 0.05em;
      margin-left: auto;
    }
    &-source-icon {
      margin-left: 0.25em;
      opacity: 0.3;
    }

    &-feed {
      display: flex;
      border-radius: 10px;
      // box-shadow: 0 0 15px #ddd;
      background: hsl(0, 0%, 94%);
      border: 1px solid hsl(0, 0%, 92%);
      // box-shadow: inset 0 0 10px hsl(0, 0%, 90%);
      margin-bottom: 1.25rem;
      min-height: 65px;
      overflow: hidden;

      &-items-wrapper {
        flex-grow: 1;
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        // Hide scrollbars
        padding-bottom: 30px;
        margin-bottom: -30px;
      }

      &-item {
        flex-shrink: 0;
        flex-grow: 1;
        width: 100%;
        height: 100%;
        scroll-snap-align: start;
        padding: $entity-card-padding-vertical $entity-card-padding-horizontal;
        color: inherit;
        text-decoration: none;
        font-size: 1.05rem;
        font-weight: 570;
        font-feature-settings: "calt", "frac", "case", "ss01", "ss02", "ss03"; // https://rsms.me/inter/#features/ss02
        display: flex;
        align-items: center;
        color: hsl(0, 0%, 15%);
      }
    }
  }
}

              
            
!

JS

              
                // To do: Add proper tap areas for back / forward / open
document.querySelectorAll(".entity-feed-items-wrapper").forEach((el) => {
  el.scrollTo(0, 0); // In case browser recalls scroll position
  el.addEventListener("click", () => scrollEntityFeed(el));
});

function scrollEntityFeed(wrapperEl, direction = 1) {
  // 1 for right, -1 for left
  const width = wrapperEl.getBoundingClientRect().width;
  wrapperEl.scrollTo({
    top: 0,
    left: wrapperEl.scrollLeft + direction * width,
    behavior: "smooth"
  });
}

              
            
!
999px

Console