Git Product home page Git Product logo

select2-bootstrap-theme's Introduction

A Select2 v4 Theme for Bootstrap 3

Note: Work in progress โ€“ depending on your use case, select2-bootstrap-theme might not be production-ready yet!

Demonstrations available at http://select2.github.io/select2-bootstrap-theme/

Tested with Bootstrap v3.3.5 and Select2 v4.0.0 in latest Chrome.

Installation

The Select2 Bootstrap Theme only works with Select2 v4.x. Applying the theme requires select2-bootstrap.css referenced after the default select2.css that comes with Select2:

<link rel="stylesheet" href="select2.css">
<link rel="stylesheet" href="select2-bootstrap.css">

To apply the theme, tell Select2 to do so by passing bootstrap to the theme option when initializing Select2:

$( "#dropdown" ).select2({
    theme: "bootstrap"
});
Changelog
0.1.0-beta.4
  • Added missing styles for .select2-container--focus. [#18]
  • Added support for Bootstrap's .form-inline. [#13]
  • Added basic styles for .select2-selection__clear in .select2-selection--multiple. [#11]
  • Brought Less source in line with the Sass version and fixed Less patch file and test. [`3e86f34]
0.1.0-beta.3
  • Fixed specifity problems with .form-control.select2-hidden-accessible.
0.1.0-beta.2
  • Added Less version.
0.1.0-beta.1
Contributing

The project offers Less and Sass sources for building select2-bootstrap.css; both make use of variables from either Bootstrap (Less) or Bootstrap for Sass. The demo pages are built using Jekyll and there are a bunch of Grunt tasks to ease development.

With Ruby and RubyGems, Jekyll, Bower, node.js, Less and Sass installed, run

npm install && bower install

to install all necessary development dependencies.

  • grunt copy copies assets from components to _jekyll โ€“ use this in case a new version of Twitter Bootstrap or Select2 are out and need to be tested
  • grunt build builds docs
  • grunt serve builds docs and serves them via Jekyll's --watch flag on http://localhost:4000
  • grunt watch watches for changes in src/select2-bootstrap.scss (livereload is enabled)

Develop in src/select2-bootstrap.scss and test your changes using grunt watch and grunt serve. Ideally, port your changes to lib/select2-bootstrap.less and make sure tests are passing to verify that Less and Sass compile down to the target CSS via npm test.

select2-bootstrap-theme's People

Contributors

codymullins avatar fk avatar

Watchers

 avatar

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.