Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

2.0 KB
Raw Blame
form {
  position: relative;

  > pngx-bs-icon[name="search"] {
    position: absolute;
    left: 0.6rem;
    top: .25rem;
    color: rgba(255, 255, 255, 0.6);

    @media screen and (min-width: 768px) {
      // adjust for smaller font size on non-mobile
      top: .15rem;
    }
  }

  &:focus-within {
    pngx-bs-icon[name="search"],
    .badge {
      display: none !important;
    }

    .form-control::placeholder {
      color: rgba(255, 255, 255, 0);
    }
  }

  .badge {
    font-size: 0.8rem;
  }

  .input-group .btn {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--pngx-primary-text-contrast);
    padding-top: .15rem;
    padding-bottom: .15rem;
    min-height: calc(1.3em + 0.5rem + calc(var(--bs-border-width) * 2)) !important;
  }

  .form-control {
    min-height: 2.25rem;
    color: rgba(255, 255, 255, 0.55);
    background-color: rgba(0, 0, 0, 0.16);
    padding-left: 1.8rem;
    border-color: rgba(255, 255, 255, 0.2);
    transition: all .3s ease, padding-left 0s ease, background-color 0s ease; // Safari requires all
    > input {
      outline: none;
      color: var(--pngx-primary-text-contrast);

      &::placeholder {
        color: rgba(255, 255, 255, 0.4);
      }
    }

    &:focus-within {
      background-color: rgba(0, 0, 0, 0.26);
      color: var(--bs-light);
      flex-grow: 1;
      padding-left: 0.5rem;
    }
  }

}

* {
  --pngx-focus-alpha: 0;
}

.mh-75 {
  max-height: 75vh;
}

.dropdown.show {
  // Hide the search icon when the dropdown is shown
  pngx-bs-icon[name="search"] {
    display: none !important;
  }

  .form-control {
    padding-left: 0.5rem;
  }
}

.dropdown-item {
  &:has(button:focus) {
    background-color: var(--pngx-bg-darker);
  }

  & button {
    transition: all 0.3s ease, color 0.15s ease;
    max-width: 2rem;
    overflow: hidden;
  }

  & button span {
    opacity: 0;
    transition: inherit;
  }

  &:hover button,
  &:has(button:focus) button {
    max-width: 10rem;
  }

  &:hover button span,
  &:has(button:focus) span {
    opacity: 1;
  }
}