Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <div class="container">
  <aside>
    <div class="user">
      <picture>
        <img src="https://randomuser.me/api/portraits/men/79.jpg" alt="User photo">
      </picture>
      <div class="user__info">
        <h4>Chris Warner</h4>
        <p>Auckland, NZ</p>
      </div>

    </div>
    <nav>
      <ul>
        <li>
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-grid">
            <path d="M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z" /></svg>
          <span>Dashboard</span>
        </li>
        <li>
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-users">
            <path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" />
            <circle cx="9" cy="7" r="4" />
            <path d="M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" /></svg>
          <span>Members</span>
        </li>
        <li>
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-database">
            <ellipse cx="12" cy="5" rx="9" ry="3" />
            <path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3" />
            <path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5" /></svg>
          <span>Database</span>
        </li>
        <li>
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bar-chart">
            <path d="M12 20V10M18 20V4M6 20v-4" /></svg>
          <span>Statistics</span>
        </li>
      </ul>
    </nav>
    <div class="settings">
      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-settings">
        <circle cx="12" cy="12" r="3" />
        <path d="M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z" /></svg>
      <span>Settings</span>
    </div>
  </aside>

  <main>
    <header>
      <h4>Team Members</h4>
      <p>7 Online Now</p>
      <p>View all members</p>
    </header>

    <section>
      <div class="card">
        <img src="https://randomuser.me/api/portraits/women/65.jpg" alt="Authors photo" class="card__avatar">
        <p class="card__name">Carrie Burton</p>
        <p class="card__country">New Zealand</p>
        <p class="card__article">New CSS properties min(), max(), and clamp()</p>
      </div>
      <div class="card">
        <img src="https://randomuser.me/api/portraits/men/30.jpg" alt="Authors photo" class="card__avatar">
        <p class="card__name">TK Samuels</p>
        <p class="card__country">Australia</p>
        <p class="card__article">Different Approaches to Responsive CSS Motion Path</p>
      </div>
      <div class="card">
        <img src="https://randomuser.me/api/portraits/women/63.jpg" alt="Authors photo" class="card__avatar">
        <p class="card__name">Rachel McKenna</p>
        <p class="card__country">United Kingdom</p>
        <p class="card__article">The Cost of Javascript Frameworks</p>
      </div>
      <div class="card">
        <img src="https://randomuser.me/api/portraits/men/60.jpg" alt="Authors photo" class="card__avatar">
        <p class="card__name">Stuart Neilson</p>
        <p class="card__country">USA</p>
        <p class="card__article">Creating Morphing Animations with CSS clip-path</p>
      </div>
      <div class="card">
        <img src="https://randomuser.me/api/portraits/men/29.jpg" alt="Authors photo" class="card__avatar">
        <p class="card__name">Jamie Forrest</p>
        <p class="card__country">USA</p>
        <p class="card__article">Updates to Form Controls and Focus</p>
      </div>
      <div class="card">
        <img src="https://randomuser.me/api/portraits/women/62.jpg" alt="Authors photo" class="card__avatar">
        <p class="card__name">Tania Jefferies</p>
        <p class="card__country">France</p>
        <p class="card__article">Create Diagonal Layouts Like It’s 2020</p>
      </div>
    </section>
  </main>
</div>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Lato&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

$lite-grey: #f1f1f1;
$dark-grey: #e7e7e7;
$pink: #e56586;
$white: #ffffff;

@mixin uc-ls-2 {
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: bold;
}

body {
  height: 100vh;
  background: $dark-grey;
  font-family: "Lato", sans-serif;
  display: grid;
  place-items: center;
}

a {
  text-decoration: none;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: auto;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 30% 1fr;

  img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
  }
}

aside,
main {
  padding: 3em;
}

// SIDEBAR
aside {
  background-color: #ff92b4;
  background-image: linear-gradient(174deg, #ff92b4 0%, #e56586 100%);
  font-size: 0.9rem;
  color: $white;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.user {
  display: grid;
  grid-template-columns: 40% 1fr;
  align-items: center;

  &__info {
    h4 {
      font-size: 1.1rem;
      font-weight: normal;
      letter-spacing: 1px;
      margin-bottom: 7px;
    }
    p {
      @include uc-ls-2();
    }
  }
}

nav {
  @include uc-ls-2();
  padding: 0 1em;
  margin-top: 20%;

  ul {
    li {
      display: grid;
      grid-template-columns: 30px 1fr;
      align-items: center;
      padding: 16px 0;
      cursor: pointer;
      transition: 0.2s;

      &:hover {
        span {
          color: $white;
        }
        svg {
          stroke: $white;
        }
      }

      svg {
        width: 18px;
        height: 18px;
      }
    }
    li:nth-child(2) {
      cursor: default;
    }
    li:not(:nth-child(2)) {
      color: darken($white, 16);
    }
  }
}

.settings {
  margin-top: 30%;
  padding: 0 1em;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  color: darken($white, 16);
  @include uc-ls-2();
  cursor: pointer;
  transition: 0.2s;

  &:hover {
    span {
      color: $white;
    }
    svg {
      stroke: $white;
    }
  }

  svg {
    width: 18px;
    height: 18px;
  }
}

// MAIN
main {
  background-color: $lite-grey;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
  height: 100%;
}

header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  padding: 1em 0;

  h4 {
    font-size: 1.2rem;
    font-weight: normal;
    grid-column: 1 / -1;
    margin-bottom: 20px;
  }

  p {
    @include uc-ls-2();

    &:nth-child(2) {
      color: darken($dark-grey, 30);
    }

    &:nth-child(3) {
      color: $pink;
      justify-self: end;
      cursor: pointer;

      &:hover {
        color: inherit;
      }
    }
  }
}

section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  grid-auto-rows: 1fr;
  grid-gap: 1em;
  grid-auto-flow: dense;
}

.card {
  width: 100%;
  background-color: $white;
  padding: 2em;
  border-radius: 5px;
  cursor: pointer;
  transition: 0.3s;

  &:hover {
    box-shadow: 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  }

  &__avatar {
    border-radius: 50%;
    margin-bottom: 10px;
    border: 1px solid $lite-grey;
  }

  &__name {
    @include uc-ls-2();
    color: $pink;
  }

  &__country {
    color: darken($dark-grey, 30);
    font-size: 0.8rem;
    margin: 5px 0 20px;
  }

  &__article {
    font-size: 0.9rem;
    line-height: 1.4rem;
  }
}

@media (max-width: 880px) {
  .user {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  nav {
    padding: 0;
    ul {
      li {
        grid-template-columns: 1fr;
        justify-items: center;

        svg {
          margin-bottom: 10px;
        }
      }
    }
  }

  .settings {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;

    svg {
      margin-bottom: 10px;
    }
  }
}

@media (max-width: 680px) {
  .container {
    grid-template-columns: 16% 1fr;
  }

  aside,
  main {
    padding: 3em 5px;
  }

  main {
    padding: 3em 1em;
  }

  .user {
    &__info {
      display: none;
    }
  }

  nav {
    ul {
      li {
        svg {
          width: 24px;
          height: 24px;
        }

        span {
          display: none;
        }
      }
    }
  }

  .settings {
    svg {
      width: 24px;
      height: 24px;
    }

    span {
      display: none;
    }
  }
}

              
            
!

JS

              
                /* 
Design based on this Dribble shot by Ali Sayed
https://dribbble.com/shots/4194278-Conceptual-Dashboard-UI-Team-Members-Screen/attachments/958601
*/

              
            
!
999px

Console