dotfiles

My PC Dotfiles & Website

_search.scss (1775B)


@import "variables";

.search {
  &-container {
    display: inline-block;
    align-self: flex-end;
    position: relative;
    top: -32px;
    transition: all 0.5s ease-out;
    width: 160px;
    margin-bottom: -20px;

    input {
      width: 100%;
      transition: background-color 0.2s ease-in;

      &:hover {
        background-color: var(--accent-alpha-20);
      }
    }

    @media (max-width: $tablet-max-width) {
      align-self: flex-end;
      width: 300px;
    }

    @media (max-width: $phone-max-width) {
      left: 0 !important;
      margin-bottom: 20px;
      top: 20px;
      width: 100%;
    }
  }

  &-results {
    background-color: var(--accent-alpha-20);
    backdrop-filter: blur(10px);
    border-style: inset;
    color: var(--accent-secondary);
    display: none;
    z-index: 1;
    max-height: 500px;
    overflow: auto;
    padding: 1rem;
    position: absolute;
    right: 0;
    width: 300%;

    @media (max-width: $tablet-max-width) {
      left: 0;
      width: 300px;
    }

    @media (max-width: $phone-max-width) {
      width: 100%;
    }

    &__number {
      font-size: small;
      text-align: end;
      margin: 0 0 1rem;
    }

    &__item {
      margin-bottom: 1rem;

      .title {
        margin-top: -3px;
        margin-bottom: -3px;
      }

      a {
        display: inline-block;
        font-size: $font-size;
        margin-bottom: 0.5rem;
      }

      b {
        color: var(--accent);
      }
    }

    &__items {
      list-style: none;
      margin: 0;
      padding: 0;
    }

    li {
      border-bottom: 1px solid var(--color);
      font-size: 0.9rem;
      margin-top: 1rem;

      &:first-of-type {
        margin-top: 0;
      }

      &:last-of-type {
        border: none;
      }
    }
  }
}