HTMLify

style.css
Views: 42 | Author: cody
:root {
    --primary-color: #272727;
    --text: white;
    --background: #F4F5FC;
    --sidebar-gray-background: #DCE1EB;
    --red: #F55E5E;
    --item-hover: #F0F0F0;
}

body {
  font-family: Inter, sans-serif;
  background-color: var(--background);
  padding: 16px;
  height: 100%;
}

html {
  height: 100%;
}

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

nav {
    position: sticky;
    top: 0;
    left: 0;
    min-height: 860px;
    height: 100%;
    border-radius: 16px;
    background-color: var(--primary-color);
    width: 18rem;
    padding: 16px 10px;
    display: flex;
    color: white;
    flex-direction: column;
    background-color: #FCFCFD;
    transition: all 0.1s ease-in-out;
}

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

body.collapsed nav {
  width: 76px;
}

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

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

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

.logo__wrapper {
  display: flex;
  justify-content: start;
  align-items: center;
  gap: 20px;
  padding: 8px;
  color: white;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

.logo {
  height: 42px;
  overflow: hidden;
  max-width: 100%;
  object-fit: contain;
}

.logo-small {
  height: 42px;
  overflow: hidden;
  max-width: 100%;
  display: none;
  object-fit: contain;
}

.collapsed .logo {
  display: none;
}

.collapsed .logo-small {
  display: block;
}

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

.sidebar-links ul {
  list-style-type: none;
  position: relative;
}

.sidebar-links li {
  color: var(--primary-color);
}

.collapsed .sidebar-links li {
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar-links li svg {
  stroke: var(--primary-color);
  transition: none;
  width: 28px;
  height: 28px;
}

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

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

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

.sidebar-links .active:hover {
  background-color: var(--primary-color);
  color: var(--background);
}

.sidebar-links .active:hover svg {
  stroke: var(--background);
}

.sidebar-links .active {
  text-decoration: none;
  background-color: var(
    --primary-color
  );
  color: var(--background);
}

.sidebar-links .active svg {
  stroke: var(--background);
}

.sidebar-links li a:hover {
  background-color: var(--item-hover);
  color: var(--primary-color);
}

.sidebar-links li a:hover svg {
  stroke: var(--primary-color);
}

/*? bottom sidebar */
.sidebar-bottom {
  padding: 8px;
  display: flex;
  justify-content: center;
  position: relative;
  flex-direction: column;
  margin-top: auto;
  border: 1px solid #F0F0F0;
  display: flex;
  text-align: center;
  border-radius: 16px;
  padding-top: 64px;
  margin-bottom: 48px;
}

.sidebar-bottom img {
  max-width: 164px;
  margin: 0 auto;
  width: 100%;
  margin-top: -84px;
}

.sidebar-bottom p {
  margin-top: -32px;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.sidebar-bottom button {
  border-radius: 16px;
  outline: none;
  margin: 0 auto;
  margin-bottom: -28px;
  cursor: pointer;
  max-width: 150px;
  min-height: 42px;
  font-weight: 800;
  border: 1.5px solid var(--sidebar-gray-background);
  padding: 8px 12px;
  background-color: var(--background);
  transition: all 0.2s ease-in-out;
}

.sidebar-bottom button:hover {
  background-color: var(--primary-color);
  color: var(--item-hover);
}

.notification {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--red);
  top: -3px;
  border: 3px solid var(--background);
  right: -3px;
}

/*? Expand button */

body.collapsed .expand-btn {
  justify-content: center;
  margin-top: auto;
}

.expand-btn:hover {
  background-color: var(--item-hover);
}

.expand-btn {
  display: flex;
  justify-content: start;
  align-items: center;
  cursor: pointer;
  gap: 8px;

  color: var(--primary-color);
  border-radius: 8px;
  padding: 8px;
}

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

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

/* ?Tooltip */

.tooltip {
  position: relative;
}

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

.collapsed .tooltip:hover .tooltip__content {
  visibility: visible;
}

Comments