#16 Expand Simple Navbar

Preview

HTML

SCSS


*, ::after, ::before {
  box-sizing: border-box;
}

/* css element */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

nav.menu-bar {
  width: 80px;
  transition: width .7s;
  background-color: #ffffff;
  overflow: hidden;
  padding: 25px 0;
  font-family: 'Montserrat', sans-serif;

  &:hover {
    width: 230px;
  }

  ul {
    list-style: none;
    padding: 0;
    margin: 0;
    
    li {
      width: 230px;
      
      a {
        border-left: 5px solid transparent;
        text-decoration: none;
        padding: 15px 20px;
        display: block;
        
        svg {
          width: 30px;
          fill: #8492A6;
          vertical-align: middle;
        }
        
        span {
          margin-left: 25px;
          display: inline-block;
          font-size: 16px;
          font-weight: 400;
          color: #8492A6;
        }
        
        &:hover {
          border-left: 5px solid #F78781;
          background-color: #F0F4F8;
          
          span {
            color: #162B39;
          }
          
          svg {
            fill: #162B39;
          }
        }
      }
    }
    
    li.active {
        
      a {
        border-left: 5px solid #F78781;
        background-color: #F0F4F8;
        
        span {
          color: #162B39;
        }
        
        svg {
          fill: #162B39;
        }
      }
    }
  }
}


Notes

In the code you can replace the images, icons and font. For icons and font you may have to change the size in the css.

Help the Project

Your help is important for the success of this project. We will make this project grow for everyone.