HTMLify

style.css
Views: 42 | Author: cody
:root {
    --primary-color: #3841E6;
    --text: #EDF0F7;
    --sidebar-gray: #111926;
    --sidebar-gray-light: #F8F7FD;
    --sidebar-gray-background: #6067EB;
    --success: #00C896;
}

html {
  font-family: Poppins, sans-serif;
}

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

nav {
    position: sticky;
    top: 0;
    left: 0;
    height: 100vh;
    background-color: var(--primary-color);
    width: 18rem;
    padding: 4px 12px;
    display: flex;
    color: white;
    flex-direction: column;
    transition: width 0.5s linear;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

body.collapsed nav {
  width: 80px;
}

body.collapsed .hide {
  position: absolute;
  display: none;
  pointer-events: none;
}

/*? sidebar top */
.sidebar-top {
  position: relative;
  display: flex;
  align-items: start;
  justify-content: center;
  flex-direction: column;
  min-height: 40px;
  padding: 16px 0px;
}

body.collapsed .sidebar-top {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo__wrapper {
  display: flex;
  justify-content: start;
  align-items: center;
  gap: 20px;
  color: white;
  text-decoration: none;
}

.logo {
  width: 54px;
  height: 54px;
  background-color: var(--sidebar-gray-background);
  border-radius: 12px;
}

.expand-btn {
  top: 16px;
  right: -62px;
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  background-color: white;
  cursor: pointer;
  box-shadow: #6067EB50 0px 2px 8px 0px;
}

.expand-btn img {
  transform: rotate(180deg);
  stroke: var(--primary-color);
  width: 38px;
  height: 38px;
}


body.collapsed .expand-btn img {
  transform: rotate(360deg);
}

.sidebar-links {
  padding: 8px 0px;
  border-top: 1px solid var(--sidebar-gray-background);
}

/*? menu links */
.sidebar-links ul {
  list-style-type: none;
  position: relative;
}

.sidebar-links li {
  position: relative;
}

.sidebar-links li a {
  padding: 12px 10px;
  margin: 8px 0px;
  color: var(--sidebar-gray-light);
  font-size: 1.25rem;
  display: flex;
  justify-content: start;
  align-items: center;
  border-radius: 10px;
  height: 56px;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

.sidebar-links li a img {
  height: 34px;
  width: 34px;
}


.sidebar-links .link {
  margin-left: 30px;
}

.sidebar-links li a:hover, 
.sidebar-links li a:focus, 
.sidebar-links .active {
  width: 100%;
  text-decoration: none;
  background-color: var(--sidebar-gray-background);
  border-radius: 10px;
  outline: none;
  color: var(--sidebar-gray-light);
}

.sidebar-links .active {
  color: white;
}

/*? bottom sidebar */

.sidebar-bottom {
  padding: 8px 0px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  margin-top: auto;
}

/*? account part */
.sidebar__profile {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-direction: row;
  padding: 24px 2px;
  border-top: 1px solid var(--sidebar-gray-background);
}

.avatar__wrapper {
  position: relative;
  display: flex;
}

.avatar {
  display: block;
  width: 50px;
  height: 50px;
  cursor: pointer;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(
    -20px 0 10px rgba(0, 0, 0, 0.1)
  );
}

.avatar:hover {
  transform: scale(1.05);
  transition: all 0.2s ease-in-out;
}

.avatar__name {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-name {
  font-size: 0.95rem;
  font-weight: 800;
  text-align: left;
}

.email {
  font-size: 0.9rem;
}

.online__status {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--success);
  bottom: 3px;
  right: 3px;
}

/* * Tooltip */

.tooltip {
  position: relative;
}

.tooltip .tooltip__content {
  visibility: hidden;
  background-color: var(--sidebar-gray-background);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 6px 12px;
  position: absolute;
  z-index: 1;
  left: 75px;
}

body.collapsed .tooltip:hover .tooltip__content,
body.collapsed .tooltip:focus .tooltip__content {
  visibility: visible;
}

Comments