css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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="page">
  <div class="header">
    <div class="header__titlebar">
      <h3 class="header__titlebar__title">App Layout</h3>
    </div>
    <div class="header__menu"></div>
    <div class="header__menu"></div>
    <div class="header__menu"></div>
  </div>

  <div class="wrapper">
    <div class="sidebar">
      <div class="sidebar__menu">Menu</div>
      <div class="sidebar__menu">Menu</div>
      <div class="sidebar__menu">Menu</div>
      <div class="sidebar__menu">Menu</div>
      <div class="sidebar__menu">Menu</div>
    </div>

    <div class="main">
      <div class="main__stream">
        <div class="main__stream__content">This is some random text that will go into the first item of the first stream.</div>
        <div class="main__stream__content">This is some random text that will go into the second item of the first stream. This one will be longer, just to see how everything scales when we have longer content to account for.</div>
        <div class="main__stream__content">This is a much shorter block of text.</div>
      </div>
      <div class="main__stream">
        <div class="main__stream__content">The second stream has four items.</div>
        <div class="main__stream__content">They will have shorter blocks of text.</div>
        <div class="main__stream__content">However, the third block of text in the second stream will be longer than the other items in this stream, just to make it look interesting.</div>
        <div class="main__stream__content">This is the shortest.</div>
      </div>
      <div class="main__stream">
        <div class="main__stream__content">Since there are only two items in this last stream, I will add more text to it to give it more length. It will be longer than the other posts, especially the short posts in the second stream which contained the shortest text blocks. The third block was an exception.</div>
        <div class="main__stream__content">Since I already have one long item in this stream, I will end off with a shorter item.</div>
      </div>
    </div>
  </div>
</div>
            
          
!
            
              $menu-color: #333;
$title-color: #8DC63F;
$border-radius: 10px;
$default-spacing: 10px;
$small-screen: 400px;

.page {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.header {
  width: 100%;
  height: 50px;
  background-color: white;
  display: flex;
  flex-shrink: 0;
  
  &__titlebar {
    width: 100%;
    height: 100%;
    border-radius: $border-radius;
    background-color: $title-color;
    display: flex;
    
    &__title {
      color: white;
      margin: auto;
      font-family: sans-serif;
      font-size: 24px;
      font-weight: normal;
      letter-spacing: 3px;
      
      // shrink text on smaller screens
      @media screen and (max-width: $small-screen) {
        font-size: 14px;
        letter-spacing: 1px;
      }
    }
  }
  
  &__menu {
    width: 50px;
    flex-shrink: 0;
    border-radius: 100%;
    background-color: $menu-color;
    margin-left: $default-spacing / 2;
  }
}

.wrapper {
  background-color: #FFF;
  display: flex;
  flex-direction: row;
  padding-top: $default-spacing;
}

.sidebar {
  width: 20%;
  background-color: $menu-color;
  border-radius: $border-radius;
  padding: $default-spacing 0;
  min-height: 325px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  
  &__menu {
    border: 1px solid white;
    color: #FFF;
    font-family: sans-serif;
    font-size: 14px;
    margin: auto $default-spacing;
    padding: $default-spacing * 1.25;
    border-radius: $border-radius;
    text-align: center;
    
    // shrink text on smaller screens
    @media screen and (max-width: $small-screen) {
      font-size: 4px;
    }
  }
}

.main {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  
  &__stream {
    width: 100%;
    height: 100%;
    border: 1px solid white;
    padding-left: $default-spacing;

    &__content {
      color: #333;
      font-family: sans-serif;
      font-size: 14px;
      line-height: 1.25;
      padding: $default-spacing;
      background-color: #EEE;
      border-radius: $border-radius;
      margin-bottom: $default-spacing;
    }
    &:last-child {
      // hide last stream on smaller screens
      @media screen and (max-width: $small-screen) {
        display: none;
      }
    }
  }
}
            
          
!
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.
Loading ..................

Console