Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrap theme? #1215

Open
arcanisgk opened this issue Oct 3, 2024 · 1 comment
Open

bootstrap theme? #1215

arcanisgk opened this issue Oct 3, 2024 · 1 comment

Comments

@arcanisgk
Copy link

bootstrap theme?

@oliver681
Copy link

oliver681 commented Oct 11, 2024

@arcanisgk If you want to style single selects with the bootstrap theme, you can use/adapt the following SCSS that we use in our project:

.choices[data-type*='select'] {
  > .choices__inner {
    @extend .form-select;
    min-height: fit-content;
    padding: 0;

    > .choices__list--single {
      padding: bs.$input-padding-y 16px bs.$input-padding-y bs.$input-padding-x;
    }
  }

  // Bootstrap styles to highlight select element when focused
  &.is-focused > .choices__inner {
    border-color: bs.$form-select-focus-border-color;
    outline: 0;
    @if bs.$enable-shadows {
      @include bs.box-shadow(bs.$form-select-box-shadow, bs.$form-select-focus-box-shadow);
    } @else {
      box-shadow: bs.$form-select-focus-box-shadow;
    }
  }

  > .choices__list--dropdown {
    @extend .dropdown-menu; // Bootstrap dropdown styles
    --bs-dropdown-padding-y: 0;
  }

  &::after {
    content: none; // remove Choices dropdown icon
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants