Skip to content

A platform for community discussion. Free, open, simple.

1.4 KB
Raw Blame
.d-native-select {
  width: 100%;
  height: 2.25em;
  background: var(--token-color-background-input);
  border: var(--d-input-border);
  border-radius: var(--d-input-border-radius);
  box-sizing: border-box;
  margin: 0;
  padding: 0 2em 0 0.5em !important;
  appearance: none;
  background-image: svg-uri(
    "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='#{$primary-medium}' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m2 5 6 6 6-6'/></svg>"
  );
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 16px 12px;
  cursor: pointer;

  @include ellipsis;

  &:focus,
  &:focus-visible,
  &:focus:focus-visible,
  &:active {
    // these `!important` flags are another great case for having a button element without that pesky default styling
    &:not(:disabled) {
      background-color: var(--token-color-background-input) !important;
      color: var(--primary) !important;
      border-color: var(--tertiary);
      outline: 2px solid var(--tertiary);
      outline-offset: -2px;

      .d-icon {
        color: inherit !important;
      }
    }
  }

  &:hover:not(:disabled) {
    .discourse-no-touch & {
      background-color: var(--token-color-background-input);
      color: var(--primary);
      border-color: var(--tertiary);

      .d-icon {
        color: inherit;
      }
    }
  }
}