<!-- chat box -->
  <div class="chat">
    <div class="messages">
      <ul>
        <li><div class="message">Message 1</div></li>
        <li><div class="message">Message 2</div></li>
        <li><div class="message">Message 3</div></li>
        <li><div class="message">Message 4</div></li>
        <li><div class="message">Message 5</div></li>
        <li><div class="message">Message 6</div></li>
        <li><div class="message">Message 7</div></li>
        <li><div class="message">Message 8</div></li>
        <li><div class="message">Message 9</div></li>
        <li><div class="message">Message 10</div></li>
      </ul>
    </div>
    <input type="text" class="input" placeholder="Enter your message" >
    <div class="prompt">Press enter to send</div>
  </div>
  <!-- newsfeed -->
  <div class="container">
    <ul class="feed">
      <li><div class="card">Card 1</div></li>
      <li><div class="card">Card 2</div></li>
      <li><div class="card">Card 3</div></li>
      <li><div class="card">Card 4</div></li>
      <li><div class="card">Card 5</div></li>
      <li class="nested">
        <ul>
          <li><div class="card">Card A</div></li>
          <li><div class="card">Card B</div></li>
          <li><div class="card">Card C</div></li>
        </ul>
      </li>
      <li><div class="card">Card 6</div></li>
      <li><div class="card">Card 7</div></li>
      <li><div class="card">Card 8</div></li>
      <li><div class="card">Card 9</div></li>
      <li><div class="card">Card 10</div></li>
    </ul>
  </div>
@import url('https://fonts.googleapis.com/css?family=Roboto:300,400');

* { 
  box-sizing: border-box; 
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    margin: 0;
	  background-color: grey;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none outside none;
}

.container {
	max-width: 800px;
	margin: 0 auto;
}

.card {
	background-color: #fff;
	padding: 10px;
	margin: 10px;
	min-height: 300px;
}

.feed {
  display: flex;
  flex-wrap: wrap;
}

@supports (display: flex) and (display: contents) {
  .feed ul,
  .feed li {
    display: contents;
  }

  .card {
    flex: 1 0 40%;
  }
}

@supports (display: flex) and (not (display: contents)) {
  .feed li {
    flex: 1 0 50%;
  }

  .feed li.nested {
    flex-basis: 100%;
  }

  .feed li.nested ul {
    display: flex;
    flex-wrap: wrap;
  }
}

// Chat Style
.chat {
  background: #fff;
  border: 10px solid #000;
  bottom: 0;
  font-size: 10px;
  position: fixed;
  right: 0;
  width: 300px;
  z-index: 1001;
}

.messages {
  border-bottom: 5px solid #000;
  overflow: auto;
  padding: 0;
  max-height: 0;
  transition: max-height 500ms;
  overscroll-behavior-y: contain;
}

.message {
  background: #000;
  border-radius: 5px;
  color: #fff;
  margin: 0 20% 10px 0;
  padding: 10px;
}

.messages li:last-child .message {
  margin-bottom: 0;
}

.input {
  border: none;
  display: block;
  padding: 10px;
  width: 100%;
}

.chat:focus-within .messages {
  max-height: 300px;
  padding: 10px;
}

.chat:focus-within ~ .container {
  filter: blur(5px);
}

.prompt {
		line-height: 2em;
		max-height: 0;
		overflow: hidden;
		padding: 0 10px;
		text-align: right;
		transition: max-height 500ms; 
}
.input:not(:placeholder-shown) + .prompt {
 		max-height: 2em; 
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.