main
  - for (let i=0; i<3; i++)
    header(class="version-" + (i+1))
      .logo
        i.fas.fa-feather-alt
      nav
        ul
          li
            a(href="#")
              i.far.fa-chart-bar
              | Dashboard
          li
            a(href="#")
              i.far.fa-edit
              | Projects
          li
            a(href="#")
              i.far.fa-envelope-open
              | Posts
      a.user(href="#")
        i.far.fa-user
        | Jane Doe
View Compiled
@import url("https://fonts.googleapis.com/css2?family=Lato:wght@100;300;400;700;900&display=swap");

:root {
  --background-color: #2b2b2b;
  --foreground-color: rgba(255, 255, 255, 0.7);
  --foreground-color-active: white;
  --transition: 250ms ease-in-out;
}

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

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  
  min-height: 100vh;
  padding: 1rem;
  min-width: calc(750px + 2 * 1rem);
  
  background:
    linear-gradient(322deg,
      #ba4aff, rgba(#ba4aff, 0) 70%),
    linear-gradient(178deg,
      #008aff, rgba(#008aff, 0) 70%),
    linear-gradient(24deg,
      #00ffc6, rgba(#00ffc6, 0) 35%);
  
  font-size: 1.7rem;
  font-weight: 300;
  
  > * + * {
    margin-top: 2rem;
  }
}

header {
  display: grid;
  gap: 0.5rem;
  
  &.version-1 {
    --color: #ba4aff;

    grid-template-columns: 
      min-content
      auto
      max-content;
    grid-template-areas: 
      "logo nav user";
  }
  
  &.version-2 {
    --color: #008aff;

    grid-template-columns: 
      min-content
      auto
      max-content;
    grid-template-areas: 
      "logo nav user";
    
    > * {
      align-self: center;
    }
    
    .user {
      justify-self: end;
    }
    
    nav > ul {
      justify-content: center;
    }
  }
  
  &.version-3 {
    --color: #22d1d3;

    grid-template-columns: 
      max-content
      min-content
      auto
      min-content;
    grid-template-areas: 
      "user nav . logo";
  }
  
  padding: 0.5rem;
  width: 100%;
  min-width: 750px;
  border-radius: 0.5rem;
  
  background: var(--background-color);
  box-shadow: 3px 3px 8px 0px var(--background-color);
  
  font-family: "Lato", sans-serif;
  
  a {
    display: flex;
    align-items: center;
    
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    
    text-decoration: none;
    color: var(--foreground-color);
    
    > i {
      margin-right: 0.5em;
      
      color: var(--color);
      
      font-size: 0.7em;
      
      transition: all var(--transition);
    }
    
    overflow: hidden;
    position: relative;
    z-index: 1;
    --slantness: 4rem;
    &::after {
      content: '';
      position: absolute;
      z-index: -1;
      left: calc(
        (100% + var(--slantness))
        * -1);
      top: 0%;
      bottom: 0%;
      width: calc(100% + var(--slantness));
      clip-path: polygon(
        0% 0%,
        100% 0%,
        calc(100% - var(--slantness)) 100%,
        0% 100%
      );
      
      background: var(--color);
      opacity: 0;
      
      transition: all var(--transition);
    }
    
    &:hover {
      > i {
        color: var(--background-color);
      }
      
      &::after {
        left: 0%;
        opacity: 1;
      }
    }
  }
}

.logo {
  grid-area: logo;
  place-self: center;
  
  margin-right: 1rem;
  padding: 0.25rem;
  border-radius: 0.25rem;
  border-top-left-radius: 50%;
  border-bottom-right-radius: 50%;
  
  color: var(--color);
  
  font-size: 2rem;
  
  transition: all var(--transition);
  
  &:hover {
    background: var(--color);
    color: var(--background-color);
  }
}

nav > ul {
  grid-area: nav;
  place-self: center;
  
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 0.5rem;
  
  list-style: none;
}

.user {
  grid-area: user;
  
  box-shadow: inset 
    0px 0px 0px 2px 
    var(--color);
}
View Compiled

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css
  2. https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css

External JavaScript

This Pen doesn't use any external JavaScript resources.