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 · 2 comments
Open

bootstrap theme? #1215

arcanisgk opened this issue Oct 3, 2024 · 2 comments

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
  }
}

@arcanisgk
Copy link
Author

@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:
...

Thanks for the reply, and sorry for my delay, I'll take it into account, but I was expecting something working on all the features or inputs in which choices can be used... I have a form system in which Select2 doesn't fit well and I was thinking of using choice but I wanted it to also fit the bootstrap layout, in design issues such as size, spaces, etc.

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