Coder Social home page Coder Social logo

some css changes about select2-bootstrap4-theme HOT 5 OPEN

ttskch avatar ttskch commented on July 30, 2024 1
some css changes

from select2-bootstrap4-theme.

Comments (5)

ttskch avatar ttskch commented on July 30, 2024

@morrow95 Thanks for your feedback. But this is just your own project specific customization, isn't this? Or are there any general problems?

from select2-bootstrap4-theme.

drjele avatar drjele commented on July 30, 2024

@ttskch i also had to change the rules a bit. the variables used by @morrow95 are from bootstrap.
this is my full code:

@import '~bootstrap/scss/functions';
@import '~bootstrap/scss/variables';
@import '~bootstrap/scss/mixins';

@import '~select2';

@import '~@ttskch/select2-bootstrap4-theme/dist/select2-bootstrap4.css';

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered
{
display: block !important;
padding: 0 $input-padding-x calc(#{$input-padding-y} - 1px) $input-padding-x !important;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice
{
margin-top: calc(#{$input-padding-y} - 1px);
}

.select2-container--bootstrap4.select2-container--focus.select2-container--open .select2-selection
{
border-bottom: 1px solid $gray-400 !important;
}

from select2-bootstrap4-theme.

ttskch avatar ttskch commented on July 30, 2024

@drjele I don't know why your modifications are needed. Could you please show some problem reproducing html?

from select2-bootstrap4-theme.

drjele avatar drjele commented on July 30, 2024

my modifications fix two things for a multiple select with ajax:

  • i see a black line at the bottom when the choice list disapears, only during the transition.
  • when i select the first option the row height of the select2 control grows by one pixel.

i posted my modifications just to show that what @morrow95 says it is posible and useful .. to use the variables from the bootstrap scss, since most people using this theme also use the bootstrap css.

and one more trick .. you can create a file with all the imports and than use that where you need it.

from select2-bootstrap4-theme.

fabiocaccamo avatar fabiocaccamo commented on July 30, 2024

@morrow95 thanks for your fix, I also added:

This fix border and radius between search input and results list.

.select2-container--bootstrap4.select2-container--open .select2-selection {
    border-bottom: 0;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
}

and this make the select more responsive:

.select2-container--bootstrap4 {
    font-size: $font-size-base !important;
    width: 100% !important;
}

from select2-bootstrap4-theme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.