viewy 2.0.6

A web UI toolkit that combine the advantages of a design system and an ui library.
.menu {
  display: flex;
  align-items: stretch;

  &--vertical {
    flex-direction: column;
    gap: sp(6);

  }

  &--horizontal-nav {
    flex-direction: row;
    justify-content: space-evenly;
    gap: sp(6);
  }

  &--horizontal-tab {
    flex-direction: row;
    gap: sp(6);
  }

  // Menu Item

  .menu-item .icon {
    stroke-width: sp(2) !important;
  }


  &--vertical, &--horizontal-tab {
    .menu-item {
      border: none;
      display: flex;
      background: transparent;
      flex-direction: row;
      align-items: center;
      gap: sp(12);
      padding: sp(8) sp(16);
      border-radius: sp($border-radius / 2);
      cursor: pointer;
      transition: background 150ms, color 150ms;
      flex-wrap: nowrap;
      text-decoration: none;
      color: var(--color-text);
      white-space: nowrap;

      &:has(> .icon) {
        padding: sp(8) sp(16) sp(8) sp(10);
      }

      &--normal {
        &:hover {
          background: var(--color-hover);

          .text, .icon {
            color: var(--color-accent);
          }
        }

        &:active {
          background: var(--surface-blue);
        }

        &.menu-item {
          &--selected, &--selected:hover, &--selected:active {
            background: var(--color-accent);

            .text, .icon {
              color: var(--color-text-on-accent);
            }
          }
        }
      }

      &--destructive {
        &:hover {
          background: var(--color-hover);

          .text, .icon {
            color: var(--color-destructive);
          }
        }

        &:active {
          background: var(--surface-red);

          .text, .icon {
            color: var(--color-destructive);
          }
        }

        &.menu-item {
          &--selected, &--selected:hover, &--selected:active {
            background: var(--color-destructive);

            .text, .icon {
              color: white;
            }
          }
        }
      }
    }
  }

  &--horizontal-nav .menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: sp(4);
    padding: sp(6);
    border-radius: sp($border-radius / 2);
    cursor: pointer;
    transition: background 150ms, color 150ms;
    flex-wrap: nowrap;
    text-decoration: none;
    color: var(--color-text-disabled);
    overflow-wrap: break-word;
    position: relative;
    max-width: sp(60);
    overflow: hidden;
    &> .badge {
      position: absolute;
      left: 50%;
      top: sp(-2);
      border: sp(3) solid var(--background);
    }

    .icon {
      width: sp(18);
      height: sp(18);
    }

    .text {
      font-size: sp(10);
      line-height: sp(10);
      width: 100%;
      flex-grow: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      text-align: center;
    }

    &--normal {
      &:hover {
        .text, .icon {
          color: var(--color-accent-light);
        }
      }

      &:active {
        .text, .icon {
          color: var(--color-accent);
        }
      }

      &.menu-item {
        &--selected, &--selected:hover, &--selected:active {
          .text, .icon {
            color: var(--color-accent);
          }
        }
      }
    }

    &--destructive {
      &:hover {
        .text, .icon {
          color: var(--color-destructive-light);
        }
      }

      &:active {
        .text, .icon {
          color: var(--color-destructive);
        }
      }

      &.menu-item {
        &--selected, &--selected:hover, &--selected:active {
          .text, .icon {
            color: var(--color-destructive);
          }
        }
      }
    }
  }
}