├── .gitignore
├── Gemfile
├── Gruntfile.js
├── LICENSE
├── Makefile
├── README.md
├── _jekyll
├── 3.3.2.html
├── 3.4.1.html
├── _config.yml
├── _layouts
│ ├── default.html
│ └── minimal.html
├── css
│ ├── select2-spinner.gif
│ ├── select2.css
│ ├── select2.png
│ └── select2x2.png
├── index.html
└── select2-bootstrap.css
├── bower.json
├── compass
└── stylesheets
│ └── select2-bootstrap.scss
├── docs
├── 3.3.2.html
├── 3.4.1.html
├── css
│ ├── select2-spinner.gif
│ ├── select2.css
│ ├── select2.png
│ └── select2x2.png
├── index.html
└── select2-bootstrap.css
├── lib
├── build.less
├── build.scss
├── select2-bootstrap-css.rb
├── select2-bootstrap.less
├── select2-bootstrap.scss
└── select2-bootstrap
│ └── version.rb
├── package.json
├── select2-bootstrap-css.gemspec
├── select2-bootstrap.css
└── test
├── less_test.js
├── scss_test.js
└── support
├── less.patch
└── scss.patch
/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | bower_components
3 | node_modules
4 | .sass-cache
5 | gh-pages
6 | tmp
7 | Gemfile.lock
8 | .ruby-version
9 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | gemspec
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 | // load all grunt tasks
3 | require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
4 |
5 | // Project configuration.
6 | grunt.initConfig({
7 | nodeunit: {
8 | all: ['test/*_test.js']
9 | },
10 |
11 | sass: {
12 | options: {
13 | style: 'expanded',
14 | sourcemap: 'none'
15 | },
16 | dist: {
17 | files: {
18 | '_jekyll/select2-bootstrap.css': 'lib/build.scss',
19 | 'docs/select2-bootstrap.css': 'lib/build.scss',
20 | 'select2-bootstrap.css': 'lib/build.scss'
21 | }
22 | },
23 | test: {
24 | files: {
25 | 'tmp/select2-bootstrap.css': 'lib/build.scss'
26 | }
27 | }
28 | },
29 |
30 | jshint: {
31 | all: ['Gruntfile.js', '*.json']
32 | },
33 |
34 | bump: {
35 | options: {
36 | files: ['package.json', 'bower.json', 'lib/select2-bootstrap/version.rb'],
37 | push: false
38 | }
39 | }
40 |
41 | });
42 |
43 | };
44 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | Copyright (c) 2013 Tom Terrace
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5 |
6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7 |
8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | serve_docs:
2 | jekyll serve --watch -s _jekyll/ -d docs/
3 |
4 | build_docs:
5 | jekyll build -s _jekyll/ -d docs/
6 |
7 | pages:
8 | cd gh-pages; git pull origin gh-pages
9 | rsync --exclude .git --delete -rv _jekyll/ gh-pages/
10 | cd gh-pages; git add -u .
11 | cd gh-pages; git add .
12 | cd gh-pages; git commit -m "Updated gh-pages."
13 | cd gh-pages; git push origin gh-pages
14 |
15 | pages_setup:
16 | mkdir gh-pages
17 | git init gh-pages
18 | cd gh-pages; git remote add origin git@github.com:t0m/select2-bootstrap-css.git
19 | cd gh-pages; git fetch
20 | cd gh-pages; git checkout gh-pages
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Select2 Bootstrap CSS
2 |
3 | Simple CSS to make Select2 widgets fit in with Bootstrap.
4 |
5 | * NOTE: This is the legacy repo. You probably want the official one here: https://github.com/select2/select2-bootstrap-theme
6 |
7 | --------------------------------------------------
8 |
9 |
10 |
11 | * This branch (`master`) contains the legacy version for Bootstrap 2.
12 | * The legacy bootstrap 3 branch is here: [`bootstrap3` branch](https://github.com/t0m/select2-bootstrap-css/tree/bootstrap3).*
13 |
14 | The LESS file is located at lib/select2-bootstrap.less, and the SCSS file is located at lib/select2-bootstrap.scss.
15 |
16 | Tests are included to verify that LESS and SCSS compile down to the target CSS. To run the tests, you'll need to install [node.js](http://nodejs.org/), [Less](http://lesscss.org/), and [SASS](http://sass-lang.com/). Then you can run:
17 |
18 | npm install && bower install
19 | npm test
20 |
21 | ## Notable Changes
22 |
23 | Versions prior to 1.2.0 included a default width for select2 containers. Applying the class "input-default" to your select will line the select2 container up with a default bootstrap text input.
24 |
25 | ## Compass
26 |
27 | This library can also be used as a [Compass](http://compass-style.org/) plugin.
28 |
29 | Gemfile:
30 |
31 | gem 'select2-bootstrap-css'
32 |
33 | compass.rb:
34 |
35 | require 'select2-bootstrap-css'
36 |
37 | Your scss file:
38 |
39 | @import 'select2-bootstrap';
40 |
41 | ## Demos
42 |
43 | http://t0m.github.io/select2-bootstrap-css/
44 |
--------------------------------------------------------------------------------
/_jekyll/3.3.2.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | version: 3.3.2
4 | ---
5 |
--------------------------------------------------------------------------------
/_jekyll/3.4.1.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | version: 3.4.1
4 | ---
5 |
--------------------------------------------------------------------------------
/_jekyll/_config.yml:
--------------------------------------------------------------------------------
1 | versions:
2 | - 3.3.2
3 | - 3.4.1
--------------------------------------------------------------------------------
/_jekyll/_layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Select2 version {{ page.version }}
13 |
14 |
15 | {% for version in site.versions %}
16 | - {{ version }}
17 | {% endfor %}
18 |
19 |
20 |
183 |
184 |
193 |
194 |
195 |
--------------------------------------------------------------------------------
/_jekyll/_layouts/minimal.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Select2 Bootstrap CSS
14 |
15 | {{ content }}
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/_jekyll/css/select2-spinner.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t0m/select2-bootstrap-css/1855431d073b3f047381ac1427f2a44c4ba18266/_jekyll/css/select2-spinner.gif
--------------------------------------------------------------------------------
/_jekyll/css/select2.css:
--------------------------------------------------------------------------------
1 | /*
2 | Version: 3.3.2 Timestamp: Mon Mar 25 12:14:18 PDT 2013
3 | */
4 | .select2-container {
5 | position: relative;
6 | display: inline-block;
7 | /* inline-block for ie7 */
8 | zoom: 1;
9 | *display: inline;
10 | vertical-align: middle;
11 | }
12 |
13 | .select2-container,
14 | .select2-drop,
15 | .select2-search,
16 | .select2-search input{
17 | /*
18 | Force border-box so that % widths fit the parent
19 | container without overlap because of margin/padding.
20 |
21 | More Info : http://www.quirksmode.org/css/box.html
22 | */
23 | -webkit-box-sizing: border-box; /* webkit */
24 | -khtml-box-sizing: border-box; /* konqueror */
25 | -moz-box-sizing: border-box; /* firefox */
26 | -ms-box-sizing: border-box; /* ie */
27 | box-sizing: border-box; /* css3 */
28 | }
29 |
30 | .select2-container .select2-choice {
31 | display: block;
32 | height: 26px;
33 | padding: 0 0 0 8px;
34 | overflow: hidden;
35 | position: relative;
36 |
37 | border: 1px solid #aaa;
38 | white-space: nowrap;
39 | line-height: 26px;
40 | color: #444;
41 | text-decoration: none;
42 |
43 | -webkit-border-radius: 4px;
44 | -moz-border-radius: 4px;
45 | border-radius: 4px;
46 |
47 | -webkit-background-clip: padding-box;
48 | -moz-background-clip: padding;
49 | background-clip: padding-box;
50 |
51 | -webkit-touch-callout: none;
52 | -webkit-user-select: none;
53 | -khtml-user-select: none;
54 | -moz-user-select: none;
55 | -ms-user-select: none;
56 | user-select: none;
57 |
58 | background-color: #fff;
59 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
60 | background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
61 | background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
62 | background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%);
63 | background-image: -ms-linear-gradient(top, #ffffff 0%, #eeeeee 50%);
64 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
65 | background-image: linear-gradient(top, #ffffff 0%, #eeeeee 50%);
66 | }
67 |
68 | .select2-container.select2-drop-above .select2-choice {
69 | border-bottom-color: #aaa;
70 |
71 | -webkit-border-radius:0 0 4px 4px;
72 | -moz-border-radius:0 0 4px 4px;
73 | border-radius:0 0 4px 4px;
74 |
75 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white));
76 | background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%);
77 | background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%);
78 | background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%);
79 | background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%);
80 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
81 | background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
82 | }
83 |
84 | .select2-container .select2-choice span {
85 | margin-right: 26px;
86 | display: block;
87 | overflow: hidden;
88 |
89 | white-space: nowrap;
90 |
91 | -ms-text-overflow: ellipsis;
92 | -o-text-overflow: ellipsis;
93 | text-overflow: ellipsis;
94 | }
95 |
96 | .select2-container .select2-choice abbr {
97 | display: block;
98 | width: 12px;
99 | height: 12px;
100 | position: absolute;
101 | right: 26px;
102 | top: 8px;
103 |
104 | font-size: 1px;
105 | text-decoration: none;
106 |
107 | border: 0;
108 | background: url('select2.png') right top no-repeat;
109 | cursor: pointer;
110 | outline: 0;
111 | }
112 | .select2-container .select2-choice abbr:hover {
113 | background-position: right -11px;
114 | cursor: pointer;
115 | }
116 |
117 | .select2-drop-mask {
118 | position: absolute;
119 | left: 0;
120 | top: 0;
121 | z-index: 9998;
122 | background-color: #fff;
123 | opacity: 0;
124 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* works in IE 8 */
125 | filter: "alpha(opacity=0)"; /* expected to work in IE 8 */
126 | filter: alpha(opacity=0); /* IE 4-7 */
127 | }
128 |
129 | .select2-drop {
130 | width: 100%;
131 | margin-top:-1px;
132 | position: absolute;
133 | z-index: 9999;
134 | top: 100%;
135 |
136 | background: #fff;
137 | color: #000;
138 | border: 1px solid #aaa;
139 | border-top: 0;
140 |
141 | -webkit-border-radius: 0 0 4px 4px;
142 | -moz-border-radius: 0 0 4px 4px;
143 | border-radius: 0 0 4px 4px;
144 |
145 | -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
146 | -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
147 | box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
148 | }
149 |
150 | .select2-drop.select2-drop-above {
151 | margin-top: 1px;
152 | border-top: 1px solid #aaa;
153 | border-bottom: 0;
154 |
155 | -webkit-border-radius: 4px 4px 0 0;
156 | -moz-border-radius: 4px 4px 0 0;
157 | border-radius: 4px 4px 0 0;
158 |
159 | -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
160 | -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
161 | box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
162 | }
163 |
164 | .select2-container .select2-choice div {
165 | display: block;
166 | width: 18px;
167 | height: 100%;
168 | position: absolute;
169 | right: 0;
170 | top: 0;
171 |
172 | border-left: 1px solid #aaa;
173 | -webkit-border-radius: 0 4px 4px 0;
174 | -moz-border-radius: 0 4px 4px 0;
175 | border-radius: 0 4px 4px 0;
176 |
177 | -webkit-background-clip: padding-box;
178 | -moz-background-clip: padding;
179 | background-clip: padding-box;
180 |
181 | background: #ccc;
182 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
183 | background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
184 | background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
185 | background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
186 | background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);
187 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
188 | background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%);
189 | }
190 |
191 | .select2-container .select2-choice div b {
192 | display: block;
193 | width: 100%;
194 | height: 100%;
195 | background: url('select2.png') no-repeat 0 1px;
196 | }
197 |
198 | .select2-search {
199 | display: inline-block;
200 | width: 100%;
201 | min-height: 26px;
202 | margin: 0;
203 | padding-left: 4px;
204 | padding-right: 4px;
205 |
206 | position: relative;
207 | z-index: 10000;
208 |
209 | white-space: nowrap;
210 | }
211 |
212 | .select2-search-hidden {
213 | display: block;
214 | position: absolute;
215 | left: -10000px;
216 | }
217 |
218 | .select2-search input {
219 | width: 100%;
220 | height: auto !important;
221 | min-height: 26px;
222 | padding: 4px 20px 4px 5px;
223 | margin: 0;
224 |
225 | outline: 0;
226 | font-family: sans-serif;
227 | font-size: 1em;
228 |
229 | border: 1px solid #aaa;
230 | -webkit-border-radius: 0;
231 | -moz-border-radius: 0;
232 | border-radius: 0;
233 |
234 | -webkit-box-shadow: none;
235 | -moz-box-shadow: none;
236 | box-shadow: none;
237 |
238 | background: #fff url('select2.png') no-repeat 100% -22px;
239 | background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
240 | background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
241 | background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
242 | background: url('select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
243 | background: url('select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
244 | background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
245 | }
246 |
247 | .select2-drop.select2-drop-above .select2-search input {
248 | margin-top: 4px;
249 | }
250 |
251 | .select2-search input.select2-active {
252 | background: #fff url('select2-spinner.gif') no-repeat 100%;
253 | background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
254 | background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
255 | background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
256 | background: url('select2-spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
257 | background: url('select2-spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
258 | background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
259 | }
260 |
261 | .select2-container-active .select2-choice,
262 | .select2-container-active .select2-choices {
263 | border: 1px solid #5897fb;
264 | outline: none;
265 |
266 | -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
267 | -moz-box-shadow: 0 0 5px rgba(0,0,0,.3);
268 | box-shadow: 0 0 5px rgba(0,0,0,.3);
269 | }
270 |
271 | .select2-dropdown-open .select2-choice {
272 | border-bottom-color: transparent;
273 | -webkit-box-shadow: 0 1px 0 #fff inset;
274 | -moz-box-shadow: 0 1px 0 #fff inset;
275 | box-shadow: 0 1px 0 #fff inset;
276 |
277 | -webkit-border-bottom-left-radius: 0;
278 | -moz-border-radius-bottomleft: 0;
279 | border-bottom-left-radius: 0;
280 |
281 | -webkit-border-bottom-right-radius: 0;
282 | -moz-border-radius-bottomright: 0;
283 | border-bottom-right-radius: 0;
284 |
285 | background-color: #eee;
286 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
287 | background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
288 | background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
289 | background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
290 | background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
291 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
292 | background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
293 | }
294 |
295 | .select2-dropdown-open .select2-choice div {
296 | background: transparent;
297 | border-left: none;
298 | filter: none;
299 | }
300 | .select2-dropdown-open .select2-choice div b {
301 | background-position: -18px 1px;
302 | }
303 |
304 | /* results */
305 | .select2-results {
306 | max-height: 200px;
307 | padding: 0 0 0 4px;
308 | margin: 4px 4px 4px 0;
309 | position: relative;
310 | overflow-x: hidden;
311 | overflow-y: auto;
312 | -webkit-tap-highlight-color: rgba(0,0,0,0);
313 | }
314 |
315 | .select2-results ul.select2-result-sub {
316 | margin: 0;
317 | }
318 |
319 | .select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
320 | .select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px }
321 | .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px }
322 | .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px }
323 | .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px }
324 | .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px }
325 | .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px }
326 |
327 | .select2-results li {
328 | list-style: none;
329 | display: list-item;
330 | background-image: none;
331 | }
332 |
333 | .select2-results li.select2-result-with-children > .select2-result-label {
334 | font-weight: bold;
335 | }
336 |
337 | .select2-results .select2-result-label {
338 | padding: 3px 7px 4px;
339 | margin: 0;
340 | cursor: pointer;
341 |
342 | min-height: 1em;
343 |
344 | -webkit-touch-callout: none;
345 | -webkit-user-select: none;
346 | -khtml-user-select: none;
347 | -moz-user-select: none;
348 | -ms-user-select: none;
349 | user-select: none;
350 | }
351 |
352 | .select2-results .select2-highlighted {
353 | background: #3875d7;
354 | color: #fff;
355 | }
356 |
357 | .select2-results li em {
358 | background: #feffde;
359 | font-style: normal;
360 | }
361 |
362 | .select2-results .select2-highlighted em {
363 | background: transparent;
364 | }
365 |
366 | .select2-results .select2-highlighted ul {
367 | background: white;
368 | color: #000;
369 | }
370 |
371 |
372 | .select2-results .select2-no-results,
373 | .select2-results .select2-searching,
374 | .select2-results .select2-selection-limit {
375 | background: #f4f4f4;
376 | display: list-item;
377 | }
378 |
379 | /*
380 | disabled look for disabled choices in the results dropdown
381 | */
382 | .select2-results .select2-disabled.select2-highlighted {
383 | color: #666;
384 | background: #f4f4f4;
385 | display: list-item;
386 | cursor: default;
387 | }
388 | .select2-results .select2-disabled {
389 | background: #f4f4f4;
390 | display: list-item;
391 | cursor: default;
392 | }
393 |
394 | .select2-results .select2-selected {
395 | display: none;
396 | }
397 |
398 | .select2-more-results.select2-active {
399 | background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
400 | }
401 |
402 | .select2-more-results {
403 | background: #f4f4f4;
404 | display: list-item;
405 | }
406 |
407 | /* disabled styles */
408 |
409 | .select2-container.select2-container-disabled .select2-choice {
410 | background-color: #f4f4f4;
411 | background-image: none;
412 | border: 1px solid #ddd;
413 | cursor: default;
414 | }
415 |
416 | .select2-container.select2-container-disabled .select2-choice div {
417 | background-color: #f4f4f4;
418 | background-image: none;
419 | border-left: 0;
420 | }
421 |
422 | .select2-container.select2-container-disabled .select2-choice abbr {
423 | display: none
424 | }
425 |
426 |
427 | /* multiselect */
428 |
429 | .select2-container-multi .select2-choices {
430 | height: auto !important;
431 | height: 1%;
432 | margin: 0;
433 | padding: 0;
434 | position: relative;
435 |
436 | border: 1px solid #aaa;
437 | cursor: text;
438 | overflow: hidden;
439 |
440 | background-color: #fff;
441 | background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
442 | background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
443 | background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
444 | background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
445 | background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
446 | background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
447 | }
448 |
449 | .select2-locked {
450 | padding: 3px 5px 3px 5px !important;
451 | }
452 |
453 | .select2-container-multi .select2-choices {
454 | min-height: 26px;
455 | }
456 |
457 | .select2-container-multi.select2-container-active .select2-choices {
458 | border: 1px solid #5897fb;
459 | outline: none;
460 |
461 | -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
462 | -moz-box-shadow: 0 0 5px rgba(0,0,0,.3);
463 | box-shadow: 0 0 5px rgba(0,0,0,.3);
464 | }
465 | .select2-container-multi .select2-choices li {
466 | float: left;
467 | list-style: none;
468 | }
469 | .select2-container-multi .select2-choices .select2-search-field {
470 | margin: 0;
471 | padding: 0;
472 | white-space: nowrap;
473 | }
474 |
475 | .select2-container-multi .select2-choices .select2-search-field input {
476 | padding: 5px;
477 | margin: 1px 0;
478 |
479 | font-family: sans-serif;
480 | font-size: 100%;
481 | color: #666;
482 | outline: 0;
483 | border: 0;
484 | -webkit-box-shadow: none;
485 | -moz-box-shadow: none;
486 | box-shadow: none;
487 | background: transparent !important;
488 | }
489 |
490 | .select2-container-multi .select2-choices .select2-search-field input.select2-active {
491 | background: #fff url('select2-spinner.gif') no-repeat 100% !important;
492 | }
493 |
494 | .select2-default {
495 | color: #999 !important;
496 | }
497 |
498 | .select2-container-multi .select2-choices .select2-search-choice {
499 | padding: 3px 5px 3px 18px;
500 | margin: 3px 0 3px 5px;
501 | position: relative;
502 |
503 | line-height: 13px;
504 | color: #333;
505 | cursor: default;
506 | border: 1px solid #aaaaaa;
507 |
508 | -webkit-border-radius: 3px;
509 | -moz-border-radius: 3px;
510 | border-radius: 3px;
511 |
512 | -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
513 | -moz-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
514 | box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
515 |
516 | -webkit-background-clip: padding-box;
517 | -moz-background-clip: padding;
518 | background-clip: padding-box;
519 |
520 | -webkit-touch-callout: none;
521 | -webkit-user-select: none;
522 | -khtml-user-select: none;
523 | -moz-user-select: none;
524 | -ms-user-select: none;
525 | user-select: none;
526 |
527 | background-color: #e4e4e4;
528 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0 );
529 | background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
530 | background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
531 | background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
532 | background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
533 | background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
534 | background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
535 | }
536 | .select2-container-multi .select2-choices .select2-search-choice span {
537 | cursor: default;
538 | }
539 | .select2-container-multi .select2-choices .select2-search-choice-focus {
540 | background: #d4d4d4;
541 | }
542 |
543 | .select2-search-choice-close {
544 | display: block;
545 | width: 12px;
546 | height: 13px;
547 | position: absolute;
548 | right: 3px;
549 | top: 4px;
550 |
551 | font-size: 1px;
552 | outline: none;
553 | background: url('select2.png') right top no-repeat;
554 | }
555 |
556 | .select2-container-multi .select2-search-choice-close {
557 | left: 3px;
558 | }
559 |
560 | .select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
561 | background-position: right -11px;
562 | }
563 | .select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
564 | background-position: right -11px;
565 | }
566 |
567 | /* disabled styles */
568 | .select2-container-multi.select2-container-disabled .select2-choices{
569 | background-color: #f4f4f4;
570 | background-image: none;
571 | border: 1px solid #ddd;
572 | cursor: default;
573 | }
574 |
575 | .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
576 | padding: 3px 5px 3px 5px;
577 | border: 1px solid #ddd;
578 | background-image: none;
579 | background-color: #f4f4f4;
580 | }
581 |
582 | .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close {
583 | display: none;
584 | }
585 | /* end multiselect */
586 |
587 |
588 | .select2-result-selectable .select2-match,
589 | .select2-result-unselectable .select2-match {
590 | text-decoration: underline;
591 | }
592 |
593 | .select2-offscreen {
594 | border: 0;
595 | clip: rect(0 0 0 0);
596 | height: 1px;
597 | margin: -1px;
598 | overflow: hidden;
599 | padding: 0;
600 | position: absolute;
601 | width: 1px;
602 | }
603 |
604 | /* Retina-ize icons */
605 |
606 | @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {
607 | .select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
608 | background-image: url('select2x2.png') !important;
609 | background-repeat: no-repeat !important;
610 | background-size: 60px 40px !important;
611 | }
612 | .select2-search input {
613 | background-position: 100% -21px !important;
614 | }
615 | }
616 |
--------------------------------------------------------------------------------
/_jekyll/css/select2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t0m/select2-bootstrap-css/1855431d073b3f047381ac1427f2a44c4ba18266/_jekyll/css/select2.png
--------------------------------------------------------------------------------
/_jekyll/css/select2x2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t0m/select2-bootstrap-css/1855431d073b3f047381ac1427f2a44c4ba18266/_jekyll/css/select2x2.png
--------------------------------------------------------------------------------
/_jekyll/index.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: minimal
3 | ---
4 |
5 | Demos
6 |
7 |
12 |
--------------------------------------------------------------------------------
/_jekyll/select2-bootstrap.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Select2 Bootstrap CSS v1.2.5
3 | * Tested with Bootstrap v2.3.1, v2.3.2 and Select2 v3.3.2, v3.4.1
4 | * MIT License
5 | */
6 | .select2-container {
7 | vertical-align: middle;
8 | }
9 | .select2-container.input-mini {
10 | width: 60px;
11 | }
12 | .select2-container.input-small {
13 | width: 90px;
14 | }
15 | .select2-container.input-medium {
16 | width: 150px;
17 | }
18 | .select2-container.input-large {
19 | width: 210px;
20 | }
21 | .select2-container.input-xlarge {
22 | width: 270px;
23 | }
24 | .select2-container.input-xxlarge {
25 | width: 530px;
26 | }
27 | .select2-container.input-default {
28 | width: 220px;
29 | }
30 | .select2-container[class*="span"] {
31 | float: none;
32 | margin-left: 0;
33 | }
34 |
35 | .select2-container .select2-choice,
36 | .select2-container-multi .select2-choices {
37 | height: 28px;
38 | line-height: 29px;
39 | border: 1px solid #ccc;
40 | -webkit-border-radius: 4px;
41 | -moz-border-radius: 4px;
42 | border-radius: 4px;
43 | background: none;
44 | background-color: #fff;
45 | filter: none;
46 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
47 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
48 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
49 | }
50 |
51 | .select2-container .select2-choice div, .select2-container .select2-choice .select2-arrow,
52 | .select2-container.select2-container-disabled .select2-choice div,
53 | .select2-container.select2-container-disabled .select2-choice .select2-arrow {
54 | border-left: none;
55 | background: none;
56 | filter: none;
57 | }
58 |
59 | .control-group.error [class^="select2-choice"] {
60 | border-color: #b94a48;
61 | }
62 |
63 | .select2-container-multi .select2-choices .select2-search-field {
64 | height: 28px;
65 | line-height: 27px;
66 | }
67 |
68 | .select2-drop.select2-drop-active,
69 | .select2-container-active .select2-choice,
70 | .select2-container-multi.select2-container-active .select2-choices {
71 | border-color: rgba(82, 168, 236, 0.8);
72 | border-color: #ccc\0;
73 | outline: none;
74 | }
75 |
76 | .select2-container-active .select2-choice,
77 | .select2-container-multi.select2-container-active .select2-choices {
78 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
79 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
80 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
81 | }
82 |
83 | [class^="input-"] .select2-container {
84 | font-size: 14px;
85 | }
86 |
87 | .input-prepend [class^="select2-choice"] {
88 | border-top-left-radius: 0;
89 | border-bottom-left-radius: 0;
90 | }
91 |
92 | .input-append [class^="select2-choice"] {
93 | border-top-right-radius: 0;
94 | border-bottom-right-radius: 0;
95 | }
96 |
97 | .select2-dropdown-open [class^="select2-choice"] {
98 | border-bottom-left-radius: 0;
99 | border-bottom-right-radius: 0;
100 | }
101 |
102 | .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
103 | border-top-left-radius: 0;
104 | border-top-right-radius: 0;
105 | }
106 |
107 | [class^="input-"] .select2-offscreen {
108 | position: absolute;
109 | }
110 |
111 | /**
112 | * This stops the quick flash when a native selectbox is shown and
113 | * then replaced by a select2 input when javascript kicks in. This can be
114 | * removed if javascript is not present
115 | */
116 | select.select2 {
117 | height: 28px;
118 | visibility: hidden;
119 | }
120 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "select2-bootstrap-css",
3 | "version": "1.2.5",
4 | "main": [
5 | "select2-bootstrap.css"
6 | ],
7 | "ignore": [
8 | "**/.*",
9 | "node_modules",
10 | "components"
11 | ],
12 | "dependencies": {
13 | "select2": "^3.3.2"
14 | },
15 | "devDependencies": {
16 | "bootstrap": "~2.3.2",
17 | "sass-bootstrap": "git://github.com/jlong/sass-twitter-bootstrap.git#~2.3.2"
18 | }
19 | }
--------------------------------------------------------------------------------
/compass/stylesheets/select2-bootstrap.scss:
--------------------------------------------------------------------------------
1 | @import "../../lib/select2-bootstrap";
--------------------------------------------------------------------------------
/docs/3.3.2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Select2 version 3.3.2
13 |
14 |
21 |
22 |
185 |
186 |
195 |
196 |
197 |
--------------------------------------------------------------------------------
/docs/3.4.1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Select2 version 3.4.1
13 |
14 |
21 |
22 |
185 |
186 |
195 |
196 |
197 |
--------------------------------------------------------------------------------
/docs/css/select2-spinner.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t0m/select2-bootstrap-css/1855431d073b3f047381ac1427f2a44c4ba18266/docs/css/select2-spinner.gif
--------------------------------------------------------------------------------
/docs/css/select2.css:
--------------------------------------------------------------------------------
1 | /*
2 | Version: 3.3.2 Timestamp: Mon Mar 25 12:14:18 PDT 2013
3 | */
4 | .select2-container {
5 | position: relative;
6 | display: inline-block;
7 | /* inline-block for ie7 */
8 | zoom: 1;
9 | *display: inline;
10 | vertical-align: middle;
11 | }
12 |
13 | .select2-container,
14 | .select2-drop,
15 | .select2-search,
16 | .select2-search input{
17 | /*
18 | Force border-box so that % widths fit the parent
19 | container without overlap because of margin/padding.
20 |
21 | More Info : http://www.quirksmode.org/css/box.html
22 | */
23 | -webkit-box-sizing: border-box; /* webkit */
24 | -khtml-box-sizing: border-box; /* konqueror */
25 | -moz-box-sizing: border-box; /* firefox */
26 | -ms-box-sizing: border-box; /* ie */
27 | box-sizing: border-box; /* css3 */
28 | }
29 |
30 | .select2-container .select2-choice {
31 | display: block;
32 | height: 26px;
33 | padding: 0 0 0 8px;
34 | overflow: hidden;
35 | position: relative;
36 |
37 | border: 1px solid #aaa;
38 | white-space: nowrap;
39 | line-height: 26px;
40 | color: #444;
41 | text-decoration: none;
42 |
43 | -webkit-border-radius: 4px;
44 | -moz-border-radius: 4px;
45 | border-radius: 4px;
46 |
47 | -webkit-background-clip: padding-box;
48 | -moz-background-clip: padding;
49 | background-clip: padding-box;
50 |
51 | -webkit-touch-callout: none;
52 | -webkit-user-select: none;
53 | -khtml-user-select: none;
54 | -moz-user-select: none;
55 | -ms-user-select: none;
56 | user-select: none;
57 |
58 | background-color: #fff;
59 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
60 | background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
61 | background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
62 | background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%);
63 | background-image: -ms-linear-gradient(top, #ffffff 0%, #eeeeee 50%);
64 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
65 | background-image: linear-gradient(top, #ffffff 0%, #eeeeee 50%);
66 | }
67 |
68 | .select2-container.select2-drop-above .select2-choice {
69 | border-bottom-color: #aaa;
70 |
71 | -webkit-border-radius:0 0 4px 4px;
72 | -moz-border-radius:0 0 4px 4px;
73 | border-radius:0 0 4px 4px;
74 |
75 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white));
76 | background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%);
77 | background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%);
78 | background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%);
79 | background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%);
80 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
81 | background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
82 | }
83 |
84 | .select2-container .select2-choice span {
85 | margin-right: 26px;
86 | display: block;
87 | overflow: hidden;
88 |
89 | white-space: nowrap;
90 |
91 | -ms-text-overflow: ellipsis;
92 | -o-text-overflow: ellipsis;
93 | text-overflow: ellipsis;
94 | }
95 |
96 | .select2-container .select2-choice abbr {
97 | display: block;
98 | width: 12px;
99 | height: 12px;
100 | position: absolute;
101 | right: 26px;
102 | top: 8px;
103 |
104 | font-size: 1px;
105 | text-decoration: none;
106 |
107 | border: 0;
108 | background: url('select2.png') right top no-repeat;
109 | cursor: pointer;
110 | outline: 0;
111 | }
112 | .select2-container .select2-choice abbr:hover {
113 | background-position: right -11px;
114 | cursor: pointer;
115 | }
116 |
117 | .select2-drop-mask {
118 | position: absolute;
119 | left: 0;
120 | top: 0;
121 | z-index: 9998;
122 | background-color: #fff;
123 | opacity: 0;
124 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* works in IE 8 */
125 | filter: "alpha(opacity=0)"; /* expected to work in IE 8 */
126 | filter: alpha(opacity=0); /* IE 4-7 */
127 | }
128 |
129 | .select2-drop {
130 | width: 100%;
131 | margin-top:-1px;
132 | position: absolute;
133 | z-index: 9999;
134 | top: 100%;
135 |
136 | background: #fff;
137 | color: #000;
138 | border: 1px solid #aaa;
139 | border-top: 0;
140 |
141 | -webkit-border-radius: 0 0 4px 4px;
142 | -moz-border-radius: 0 0 4px 4px;
143 | border-radius: 0 0 4px 4px;
144 |
145 | -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
146 | -moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
147 | box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
148 | }
149 |
150 | .select2-drop.select2-drop-above {
151 | margin-top: 1px;
152 | border-top: 1px solid #aaa;
153 | border-bottom: 0;
154 |
155 | -webkit-border-radius: 4px 4px 0 0;
156 | -moz-border-radius: 4px 4px 0 0;
157 | border-radius: 4px 4px 0 0;
158 |
159 | -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
160 | -moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
161 | box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
162 | }
163 |
164 | .select2-container .select2-choice div {
165 | display: block;
166 | width: 18px;
167 | height: 100%;
168 | position: absolute;
169 | right: 0;
170 | top: 0;
171 |
172 | border-left: 1px solid #aaa;
173 | -webkit-border-radius: 0 4px 4px 0;
174 | -moz-border-radius: 0 4px 4px 0;
175 | border-radius: 0 4px 4px 0;
176 |
177 | -webkit-background-clip: padding-box;
178 | -moz-background-clip: padding;
179 | background-clip: padding-box;
180 |
181 | background: #ccc;
182 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
183 | background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
184 | background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
185 | background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
186 | background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);
187 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
188 | background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%);
189 | }
190 |
191 | .select2-container .select2-choice div b {
192 | display: block;
193 | width: 100%;
194 | height: 100%;
195 | background: url('select2.png') no-repeat 0 1px;
196 | }
197 |
198 | .select2-search {
199 | display: inline-block;
200 | width: 100%;
201 | min-height: 26px;
202 | margin: 0;
203 | padding-left: 4px;
204 | padding-right: 4px;
205 |
206 | position: relative;
207 | z-index: 10000;
208 |
209 | white-space: nowrap;
210 | }
211 |
212 | .select2-search-hidden {
213 | display: block;
214 | position: absolute;
215 | left: -10000px;
216 | }
217 |
218 | .select2-search input {
219 | width: 100%;
220 | height: auto !important;
221 | min-height: 26px;
222 | padding: 4px 20px 4px 5px;
223 | margin: 0;
224 |
225 | outline: 0;
226 | font-family: sans-serif;
227 | font-size: 1em;
228 |
229 | border: 1px solid #aaa;
230 | -webkit-border-radius: 0;
231 | -moz-border-radius: 0;
232 | border-radius: 0;
233 |
234 | -webkit-box-shadow: none;
235 | -moz-box-shadow: none;
236 | box-shadow: none;
237 |
238 | background: #fff url('select2.png') no-repeat 100% -22px;
239 | background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
240 | background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
241 | background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
242 | background: url('select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
243 | background: url('select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
244 | background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
245 | }
246 |
247 | .select2-drop.select2-drop-above .select2-search input {
248 | margin-top: 4px;
249 | }
250 |
251 | .select2-search input.select2-active {
252 | background: #fff url('select2-spinner.gif') no-repeat 100%;
253 | background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
254 | background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
255 | background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
256 | background: url('select2-spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
257 | background: url('select2-spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
258 | background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
259 | }
260 |
261 | .select2-container-active .select2-choice,
262 | .select2-container-active .select2-choices {
263 | border: 1px solid #5897fb;
264 | outline: none;
265 |
266 | -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
267 | -moz-box-shadow: 0 0 5px rgba(0,0,0,.3);
268 | box-shadow: 0 0 5px rgba(0,0,0,.3);
269 | }
270 |
271 | .select2-dropdown-open .select2-choice {
272 | border-bottom-color: transparent;
273 | -webkit-box-shadow: 0 1px 0 #fff inset;
274 | -moz-box-shadow: 0 1px 0 #fff inset;
275 | box-shadow: 0 1px 0 #fff inset;
276 |
277 | -webkit-border-bottom-left-radius: 0;
278 | -moz-border-radius-bottomleft: 0;
279 | border-bottom-left-radius: 0;
280 |
281 | -webkit-border-bottom-right-radius: 0;
282 | -moz-border-radius-bottomright: 0;
283 | border-bottom-right-radius: 0;
284 |
285 | background-color: #eee;
286 | background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
287 | background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
288 | background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
289 | background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
290 | background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
291 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
292 | background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
293 | }
294 |
295 | .select2-dropdown-open .select2-choice div {
296 | background: transparent;
297 | border-left: none;
298 | filter: none;
299 | }
300 | .select2-dropdown-open .select2-choice div b {
301 | background-position: -18px 1px;
302 | }
303 |
304 | /* results */
305 | .select2-results {
306 | max-height: 200px;
307 | padding: 0 0 0 4px;
308 | margin: 4px 4px 4px 0;
309 | position: relative;
310 | overflow-x: hidden;
311 | overflow-y: auto;
312 | -webkit-tap-highlight-color: rgba(0,0,0,0);
313 | }
314 |
315 | .select2-results ul.select2-result-sub {
316 | margin: 0;
317 | }
318 |
319 | .select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
320 | .select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px }
321 | .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px }
322 | .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px }
323 | .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px }
324 | .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px }
325 | .select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px }
326 |
327 | .select2-results li {
328 | list-style: none;
329 | display: list-item;
330 | background-image: none;
331 | }
332 |
333 | .select2-results li.select2-result-with-children > .select2-result-label {
334 | font-weight: bold;
335 | }
336 |
337 | .select2-results .select2-result-label {
338 | padding: 3px 7px 4px;
339 | margin: 0;
340 | cursor: pointer;
341 |
342 | min-height: 1em;
343 |
344 | -webkit-touch-callout: none;
345 | -webkit-user-select: none;
346 | -khtml-user-select: none;
347 | -moz-user-select: none;
348 | -ms-user-select: none;
349 | user-select: none;
350 | }
351 |
352 | .select2-results .select2-highlighted {
353 | background: #3875d7;
354 | color: #fff;
355 | }
356 |
357 | .select2-results li em {
358 | background: #feffde;
359 | font-style: normal;
360 | }
361 |
362 | .select2-results .select2-highlighted em {
363 | background: transparent;
364 | }
365 |
366 | .select2-results .select2-highlighted ul {
367 | background: white;
368 | color: #000;
369 | }
370 |
371 |
372 | .select2-results .select2-no-results,
373 | .select2-results .select2-searching,
374 | .select2-results .select2-selection-limit {
375 | background: #f4f4f4;
376 | display: list-item;
377 | }
378 |
379 | /*
380 | disabled look for disabled choices in the results dropdown
381 | */
382 | .select2-results .select2-disabled.select2-highlighted {
383 | color: #666;
384 | background: #f4f4f4;
385 | display: list-item;
386 | cursor: default;
387 | }
388 | .select2-results .select2-disabled {
389 | background: #f4f4f4;
390 | display: list-item;
391 | cursor: default;
392 | }
393 |
394 | .select2-results .select2-selected {
395 | display: none;
396 | }
397 |
398 | .select2-more-results.select2-active {
399 | background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
400 | }
401 |
402 | .select2-more-results {
403 | background: #f4f4f4;
404 | display: list-item;
405 | }
406 |
407 | /* disabled styles */
408 |
409 | .select2-container.select2-container-disabled .select2-choice {
410 | background-color: #f4f4f4;
411 | background-image: none;
412 | border: 1px solid #ddd;
413 | cursor: default;
414 | }
415 |
416 | .select2-container.select2-container-disabled .select2-choice div {
417 | background-color: #f4f4f4;
418 | background-image: none;
419 | border-left: 0;
420 | }
421 |
422 | .select2-container.select2-container-disabled .select2-choice abbr {
423 | display: none
424 | }
425 |
426 |
427 | /* multiselect */
428 |
429 | .select2-container-multi .select2-choices {
430 | height: auto !important;
431 | height: 1%;
432 | margin: 0;
433 | padding: 0;
434 | position: relative;
435 |
436 | border: 1px solid #aaa;
437 | cursor: text;
438 | overflow: hidden;
439 |
440 | background-color: #fff;
441 | background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
442 | background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
443 | background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
444 | background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
445 | background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
446 | background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
447 | }
448 |
449 | .select2-locked {
450 | padding: 3px 5px 3px 5px !important;
451 | }
452 |
453 | .select2-container-multi .select2-choices {
454 | min-height: 26px;
455 | }
456 |
457 | .select2-container-multi.select2-container-active .select2-choices {
458 | border: 1px solid #5897fb;
459 | outline: none;
460 |
461 | -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
462 | -moz-box-shadow: 0 0 5px rgba(0,0,0,.3);
463 | box-shadow: 0 0 5px rgba(0,0,0,.3);
464 | }
465 | .select2-container-multi .select2-choices li {
466 | float: left;
467 | list-style: none;
468 | }
469 | .select2-container-multi .select2-choices .select2-search-field {
470 | margin: 0;
471 | padding: 0;
472 | white-space: nowrap;
473 | }
474 |
475 | .select2-container-multi .select2-choices .select2-search-field input {
476 | padding: 5px;
477 | margin: 1px 0;
478 |
479 | font-family: sans-serif;
480 | font-size: 100%;
481 | color: #666;
482 | outline: 0;
483 | border: 0;
484 | -webkit-box-shadow: none;
485 | -moz-box-shadow: none;
486 | box-shadow: none;
487 | background: transparent !important;
488 | }
489 |
490 | .select2-container-multi .select2-choices .select2-search-field input.select2-active {
491 | background: #fff url('select2-spinner.gif') no-repeat 100% !important;
492 | }
493 |
494 | .select2-default {
495 | color: #999 !important;
496 | }
497 |
498 | .select2-container-multi .select2-choices .select2-search-choice {
499 | padding: 3px 5px 3px 18px;
500 | margin: 3px 0 3px 5px;
501 | position: relative;
502 |
503 | line-height: 13px;
504 | color: #333;
505 | cursor: default;
506 | border: 1px solid #aaaaaa;
507 |
508 | -webkit-border-radius: 3px;
509 | -moz-border-radius: 3px;
510 | border-radius: 3px;
511 |
512 | -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
513 | -moz-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
514 | box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
515 |
516 | -webkit-background-clip: padding-box;
517 | -moz-background-clip: padding;
518 | background-clip: padding-box;
519 |
520 | -webkit-touch-callout: none;
521 | -webkit-user-select: none;
522 | -khtml-user-select: none;
523 | -moz-user-select: none;
524 | -ms-user-select: none;
525 | user-select: none;
526 |
527 | background-color: #e4e4e4;
528 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0 );
529 | background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
530 | background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
531 | background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
532 | background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
533 | background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
534 | background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
535 | }
536 | .select2-container-multi .select2-choices .select2-search-choice span {
537 | cursor: default;
538 | }
539 | .select2-container-multi .select2-choices .select2-search-choice-focus {
540 | background: #d4d4d4;
541 | }
542 |
543 | .select2-search-choice-close {
544 | display: block;
545 | width: 12px;
546 | height: 13px;
547 | position: absolute;
548 | right: 3px;
549 | top: 4px;
550 |
551 | font-size: 1px;
552 | outline: none;
553 | background: url('select2.png') right top no-repeat;
554 | }
555 |
556 | .select2-container-multi .select2-search-choice-close {
557 | left: 3px;
558 | }
559 |
560 | .select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
561 | background-position: right -11px;
562 | }
563 | .select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
564 | background-position: right -11px;
565 | }
566 |
567 | /* disabled styles */
568 | .select2-container-multi.select2-container-disabled .select2-choices{
569 | background-color: #f4f4f4;
570 | background-image: none;
571 | border: 1px solid #ddd;
572 | cursor: default;
573 | }
574 |
575 | .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
576 | padding: 3px 5px 3px 5px;
577 | border: 1px solid #ddd;
578 | background-image: none;
579 | background-color: #f4f4f4;
580 | }
581 |
582 | .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close {
583 | display: none;
584 | }
585 | /* end multiselect */
586 |
587 |
588 | .select2-result-selectable .select2-match,
589 | .select2-result-unselectable .select2-match {
590 | text-decoration: underline;
591 | }
592 |
593 | .select2-offscreen {
594 | border: 0;
595 | clip: rect(0 0 0 0);
596 | height: 1px;
597 | margin: -1px;
598 | overflow: hidden;
599 | padding: 0;
600 | position: absolute;
601 | width: 1px;
602 | }
603 |
604 | /* Retina-ize icons */
605 |
606 | @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {
607 | .select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
608 | background-image: url('select2x2.png') !important;
609 | background-repeat: no-repeat !important;
610 | background-size: 60px 40px !important;
611 | }
612 | .select2-search input {
613 | background-position: 100% -21px !important;
614 | }
615 | }
616 |
--------------------------------------------------------------------------------
/docs/css/select2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t0m/select2-bootstrap-css/1855431d073b3f047381ac1427f2a44c4ba18266/docs/css/select2.png
--------------------------------------------------------------------------------
/docs/css/select2x2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/t0m/select2-bootstrap-css/1855431d073b3f047381ac1427f2a44c4ba18266/docs/css/select2x2.png
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Select2 Bootstrap CSS
14 |
15 | Demos
16 |
17 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/docs/select2-bootstrap.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Select2 Bootstrap CSS v1.2.5
3 | * Tested with Bootstrap v2.3.1, v2.3.2 and Select2 v3.3.2, v3.4.1
4 | * MIT License
5 | */
6 | .select2-container {
7 | vertical-align: middle;
8 | }
9 | .select2-container.input-mini {
10 | width: 60px;
11 | }
12 | .select2-container.input-small {
13 | width: 90px;
14 | }
15 | .select2-container.input-medium {
16 | width: 150px;
17 | }
18 | .select2-container.input-large {
19 | width: 210px;
20 | }
21 | .select2-container.input-xlarge {
22 | width: 270px;
23 | }
24 | .select2-container.input-xxlarge {
25 | width: 530px;
26 | }
27 | .select2-container.input-default {
28 | width: 220px;
29 | }
30 | .select2-container[class*="span"] {
31 | float: none;
32 | margin-left: 0;
33 | }
34 |
35 | .select2-container .select2-choice,
36 | .select2-container-multi .select2-choices {
37 | height: 28px;
38 | line-height: 29px;
39 | border: 1px solid #ccc;
40 | -webkit-border-radius: 4px;
41 | -moz-border-radius: 4px;
42 | border-radius: 4px;
43 | background: none;
44 | background-color: #fff;
45 | filter: none;
46 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
47 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
48 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
49 | }
50 |
51 | .select2-container .select2-choice div, .select2-container .select2-choice .select2-arrow,
52 | .select2-container.select2-container-disabled .select2-choice div,
53 | .select2-container.select2-container-disabled .select2-choice .select2-arrow {
54 | border-left: none;
55 | background: none;
56 | filter: none;
57 | }
58 |
59 | .control-group.error [class^="select2-choice"] {
60 | border-color: #b94a48;
61 | }
62 |
63 | .select2-container-multi .select2-choices .select2-search-field {
64 | height: 28px;
65 | line-height: 27px;
66 | }
67 |
68 | .select2-drop.select2-drop-active,
69 | .select2-container-active .select2-choice,
70 | .select2-container-multi.select2-container-active .select2-choices {
71 | border-color: rgba(82, 168, 236, 0.8);
72 | border-color: #ccc\0;
73 | outline: none;
74 | }
75 |
76 | .select2-container-active .select2-choice,
77 | .select2-container-multi.select2-container-active .select2-choices {
78 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
79 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
80 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
81 | }
82 |
83 | [class^="input-"] .select2-container {
84 | font-size: 14px;
85 | }
86 |
87 | .input-prepend [class^="select2-choice"] {
88 | border-top-left-radius: 0;
89 | border-bottom-left-radius: 0;
90 | }
91 |
92 | .input-append [class^="select2-choice"] {
93 | border-top-right-radius: 0;
94 | border-bottom-right-radius: 0;
95 | }
96 |
97 | .select2-dropdown-open [class^="select2-choice"] {
98 | border-bottom-left-radius: 0;
99 | border-bottom-right-radius: 0;
100 | }
101 |
102 | .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
103 | border-top-left-radius: 0;
104 | border-top-right-radius: 0;
105 | }
106 |
107 | [class^="input-"] .select2-offscreen {
108 | position: absolute;
109 | }
110 |
111 | /**
112 | * This stops the quick flash when a native selectbox is shown and
113 | * then replaced by a select2 input when javascript kicks in. This can be
114 | * removed if javascript is not present
115 | */
116 | select.select2 {
117 | height: 28px;
118 | visibility: hidden;
119 | }
120 |
--------------------------------------------------------------------------------
/lib/build.less:
--------------------------------------------------------------------------------
1 | @import "../bower_components/bootstrap/less/variables";
2 | @import "../bower_components/bootstrap/less/mixins";
3 | @import "select2-bootstrap.less";
4 |
--------------------------------------------------------------------------------
/lib/build.scss:
--------------------------------------------------------------------------------
1 | @import "../bower_components/sass-bootstrap/lib/variables";
2 | @import "../bower_components/sass-bootstrap/lib/mixins";
3 | @import "select2-bootstrap.scss";
4 |
--------------------------------------------------------------------------------
/lib/select2-bootstrap-css.rb:
--------------------------------------------------------------------------------
1 | require 'compass'
2 |
3 | module Select2
4 | module Bootstrap
5 | def self.base_directory
6 | File.expand_path('../../compass', __FILE__)
7 | end
8 | end
9 | end
10 |
11 | Compass::Frameworks.register 'select2-bootstrap', :path => Select2::Bootstrap.base_directory
--------------------------------------------------------------------------------
/lib/select2-bootstrap.less:
--------------------------------------------------------------------------------
1 | /**
2 | * Select2 Bootstrap CSS v1.2.5
3 | * Tested with Bootstrap v2.3.1, v2.3.2 and Select2 v3.3.2, v3.4.1
4 | * MIT License
5 | */
6 |
7 | .select2-container {
8 | vertical-align: middle;
9 | &.input-mini { width: 60px; }
10 | &.input-small { width: 90px; }
11 | &.input-medium { width: 150px; }
12 | &.input-large { width: 210px; }
13 | &.input-xlarge { width: 270px; }
14 | &.input-xxlarge { width: 530px; }
15 | // Size to the width of a default text input.
16 | &.input-default { width: 220px; }
17 | &[class*="span"] {
18 | float: none;
19 | margin-left: 0;
20 | }
21 | }
22 |
23 | .select2-container .select2-choice,
24 | .select2-container-multi .select2-choices {
25 | height: @baseLineHeight + 8px;
26 | line-height: @baseLineHeight + 9px;
27 | border: 1px solid @inputBorder;
28 | .border-radius(@inputBorderRadius);
29 | background: none;
30 | background-color: @inputBackground;
31 | filter: none;
32 | .box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.075));
33 | }
34 |
35 | .select2-container .select2-choice,
36 | .select2-container.select2-container-disabled .select2-choice {
37 | div, .select2-arrow {
38 | border-left: none;
39 | background: none;
40 | filter: none;
41 | }
42 | }
43 |
44 | .control-group.error [class^="select2-choice"] {
45 | border-color: @errorText;
46 | }
47 |
48 | .select2-container-multi .select2-choices .select2-search-field {
49 | height: 28px;
50 | line-height: 27px;
51 | }
52 |
53 | .select2-drop.select2-drop-active,
54 | .select2-container-active .select2-choice,
55 | .select2-container-multi.select2-container-active .select2-choices {
56 | border-color: rgba(82, 168, 236, 0.8);
57 | border-color: #ccc\0;
58 | outline: none;
59 | }
60 |
61 | .select2-container-active .select2-choice,
62 | .select2-container-multi.select2-container-active .select2-choices {
63 | .box-shadow(~"inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6)");
64 | }
65 |
66 | [class^="input-"] .select2-container {
67 | font-size: @baseFontSize;
68 | }
69 |
70 | .input-prepend [class^="select2-choice"] {
71 | border-top-left-radius: 0;
72 | border-bottom-left-radius: 0;
73 | }
74 |
75 | .input-append [class^="select2-choice"] {
76 | border-top-right-radius: 0;
77 | border-bottom-right-radius: 0;
78 | }
79 |
80 | .select2-dropdown-open [class^="select2-choice"] {
81 | border-bottom-left-radius: 0;
82 | border-bottom-right-radius: 0;
83 | }
84 |
85 | .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
86 | border-top-left-radius: 0;
87 | border-top-right-radius: 0;
88 | }
89 |
90 | [class^="input-"] .select2-offscreen {
91 | position: absolute;
92 | }
93 |
94 | /**
95 | * This stops the quick flash when a native selectbox is shown and
96 | * then replaced by a select2 input when javascript kicks in. This can be
97 | * removed if javascript is not present
98 | */
99 |
100 | select.select2 {
101 | height: 28px;
102 | visibility: hidden;
103 | }
104 |
--------------------------------------------------------------------------------
/lib/select2-bootstrap.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Select2 Bootstrap CSS v1.2.5
3 | * Tested with Bootstrap v2.3.1, v2.3.2 and Select2 v3.3.2, v3.4.1
4 | * MIT License
5 | */
6 |
7 | .select2-container {
8 | vertical-align: middle;
9 | &.input-mini { width: 60px; }
10 | &.input-small { width: 90px; }
11 | &.input-medium { width: 150px; }
12 | &.input-large { width: 210px; }
13 | &.input-xlarge { width: 270px; }
14 | &.input-xxlarge { width: 530px; }
15 | // Size to the width of a default text input.
16 | &.input-default { width: 220px; }
17 | &[class*="span"] {
18 | float: none;
19 | margin-left: 0;
20 | }
21 | }
22 |
23 | .select2-container .select2-choice,
24 | .select2-container-multi .select2-choices {
25 | height: $baseLineHeight + 8px;
26 | line-height: $baseLineHeight + 9px;
27 | border: 1px solid $inputBorder;
28 | @include border-radius($inputBorderRadius);
29 | background: none;
30 | background-color: $inputBackground;
31 | filter: none;
32 | @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.075));
33 | }
34 |
35 | .select2-container .select2-choice,
36 | .select2-container.select2-container-disabled .select2-choice {
37 | div, .select2-arrow {
38 | border-left: none;
39 | background: none;
40 | filter: none;
41 | }
42 | }
43 |
44 | .control-group.error [class^="select2-choice"] {
45 | border-color: $errorText;
46 | }
47 |
48 | .select2-container-multi .select2-choices .select2-search-field {
49 | height: 28px;
50 | line-height: 27px;
51 | }
52 |
53 | .select2-drop.select2-drop-active,
54 | .select2-container-active .select2-choice,
55 | .select2-container-multi.select2-container-active .select2-choices {
56 | border-color: rgba(82, 168, 236, 0.8);
57 | border-color: #ccc\0;
58 | outline: none;
59 | }
60 |
61 | .select2-container-active .select2-choice,
62 | .select2-container-multi.select2-container-active .select2-choices {
63 | @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6));
64 | }
65 |
66 | [class^="input-"] .select2-container {
67 | font-size: $baseFontSize;
68 | }
69 |
70 | .input-prepend [class^="select2-choice"] {
71 | border-top-left-radius: 0;
72 | border-bottom-left-radius: 0;
73 | }
74 |
75 | .input-append [class^="select2-choice"] {
76 | border-top-right-radius: 0;
77 | border-bottom-right-radius: 0;
78 | }
79 |
80 | .select2-dropdown-open [class^="select2-choice"] {
81 | border-bottom-left-radius: 0;
82 | border-bottom-right-radius: 0;
83 | }
84 |
85 | .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
86 | border-top-left-radius: 0;
87 | border-top-right-radius: 0;
88 | }
89 |
90 | [class^="input-"] .select2-offscreen {
91 | position: absolute;
92 | }
93 |
94 | /**
95 | * This stops the quick flash when a native selectbox is shown and
96 | * then replaced by a select2 input when javascript kicks in. This can be
97 | * removed if javascript is not present
98 | */
99 |
100 | select.select2 {
101 | height: 28px;
102 | visibility: hidden;
103 | }
104 |
--------------------------------------------------------------------------------
/lib/select2-bootstrap/version.rb:
--------------------------------------------------------------------------------
1 | module Select2
2 | module Bootstrap
3 | # This is updated via the `grunt bump` command, which has a pretty
4 | # unflexible matching syntax.
5 | VERSION_STRING = "'version': '1.2.5'"
6 | # Then, just the version.
7 | VERSION = VERSION_STRING.match(/\d+\.\d+\.\d+/)[0]
8 | end
9 | end
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "select2-bootstrap-css",
3 | "version": "1.2.5",
4 | "description": "simple css to make select2 widgets fit in with bootstrap",
5 | "main": "",
6 | "directories": {
7 | "doc": "docs"
8 | },
9 | "scripts": {
10 | "test": "grunt nodeunit"
11 | },
12 | "repository": {
13 | "type": "git",
14 | "url": "git://github.com/t0m/select2-bootstrap-css.git"
15 | },
16 | "keywords": [
17 | "bootstrap",
18 | "select2"
19 | ],
20 | "author": "Michael Hellein",
21 | "license": "MIT",
22 | "readmeFilename": "README.md",
23 | "devDependencies": {
24 | "grunt": "~0.4.5",
25 | "grunt-contrib-nodeunit": "~0.4.1",
26 | "diff": "~1.3.2",
27 | "grunt-contrib-sass": "~0.9.2",
28 | "bower": "~1.4.0",
29 | "grunt-contrib-jshint": "~0.11.1",
30 | "grunt-bump": "0.3.0",
31 | "matchdep": "~0.3.0"
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/select2-bootstrap-css.gemspec:
--------------------------------------------------------------------------------
1 | # encoding: utf-8
2 |
3 | $:.unshift File.expand_path('../lib', __FILE__)
4 | require 'select2-bootstrap/version'
5 |
6 | Gem::Specification.new do |s|
7 | s.name = "select2-bootstrap-css"
8 | s.version = Select2::Bootstrap::VERSION
9 | s.authors = ["Michael Hellein"]
10 | s.email = ["themichael@gmail.com"]
11 | s.homepage = "https://github.com/t0m/select2-bootstrap-css"
12 | s.summary = "A stylesheet for making select2 fit in with bootstrap a bit better."
13 | s.description = "A stylesheet for making select2 fit in with bootstrap a bit better."
14 | s.license = 'MIT'
15 |
16 | s.files = `git ls-files compass lib`.split("\n")
17 | s.platform = Gem::Platform::RUBY
18 | s.require_paths = ['lib']
19 | s.rubyforge_project = '[none]'
20 |
21 | s.add_development_dependency 'jekyll'
22 | end
23 |
--------------------------------------------------------------------------------
/select2-bootstrap.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Select2 Bootstrap CSS v1.2.5
3 | * Tested with Bootstrap v2.3.1, v2.3.2 and Select2 v3.3.2, v3.4.1
4 | * MIT License
5 | */
6 | .select2-container {
7 | vertical-align: middle;
8 | }
9 | .select2-container.input-mini {
10 | width: 60px;
11 | }
12 | .select2-container.input-small {
13 | width: 90px;
14 | }
15 | .select2-container.input-medium {
16 | width: 150px;
17 | }
18 | .select2-container.input-large {
19 | width: 210px;
20 | }
21 | .select2-container.input-xlarge {
22 | width: 270px;
23 | }
24 | .select2-container.input-xxlarge {
25 | width: 530px;
26 | }
27 | .select2-container.input-default {
28 | width: 220px;
29 | }
30 | .select2-container[class*="span"] {
31 | float: none;
32 | margin-left: 0;
33 | }
34 |
35 | .select2-container .select2-choice,
36 | .select2-container-multi .select2-choices {
37 | height: 28px;
38 | line-height: 29px;
39 | border: 1px solid #ccc;
40 | -webkit-border-radius: 4px;
41 | -moz-border-radius: 4px;
42 | border-radius: 4px;
43 | background: none;
44 | background-color: #fff;
45 | filter: none;
46 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
47 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
48 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
49 | }
50 |
51 | .select2-container .select2-choice div, .select2-container .select2-choice .select2-arrow,
52 | .select2-container.select2-container-disabled .select2-choice div,
53 | .select2-container.select2-container-disabled .select2-choice .select2-arrow {
54 | border-left: none;
55 | background: none;
56 | filter: none;
57 | }
58 |
59 | .control-group.error [class^="select2-choice"] {
60 | border-color: #b94a48;
61 | }
62 |
63 | .select2-container-multi .select2-choices .select2-search-field {
64 | height: 28px;
65 | line-height: 27px;
66 | }
67 |
68 | .select2-drop.select2-drop-active,
69 | .select2-container-active .select2-choice,
70 | .select2-container-multi.select2-container-active .select2-choices {
71 | border-color: rgba(82, 168, 236, 0.8);
72 | border-color: #ccc\0;
73 | outline: none;
74 | }
75 |
76 | .select2-container-active .select2-choice,
77 | .select2-container-multi.select2-container-active .select2-choices {
78 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
79 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
80 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
81 | }
82 |
83 | [class^="input-"] .select2-container {
84 | font-size: 14px;
85 | }
86 |
87 | .input-prepend [class^="select2-choice"] {
88 | border-top-left-radius: 0;
89 | border-bottom-left-radius: 0;
90 | }
91 |
92 | .input-append [class^="select2-choice"] {
93 | border-top-right-radius: 0;
94 | border-bottom-right-radius: 0;
95 | }
96 |
97 | .select2-dropdown-open [class^="select2-choice"] {
98 | border-bottom-left-radius: 0;
99 | border-bottom-right-radius: 0;
100 | }
101 |
102 | .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
103 | border-top-left-radius: 0;
104 | border-top-right-radius: 0;
105 | }
106 |
107 | [class^="input-"] .select2-offscreen {
108 | position: absolute;
109 | }
110 |
111 | /**
112 | * This stops the quick flash when a native selectbox is shown and
113 | * then replaced by a select2 input when javascript kicks in. This can be
114 | * removed if javascript is not present
115 | */
116 | select.select2 {
117 | height: 28px;
118 | visibility: hidden;
119 | }
120 |
--------------------------------------------------------------------------------
/test/less_test.js:
--------------------------------------------------------------------------------
1 | exports.compileLess = function(test){
2 | var grunt = require('grunt'),
3 | fs = require('fs'),
4 | jsdiff = require('diff'),
5 | t = test,
6 | filename = 'select2-bootstrap.css',
7 | patchfile = 'test/support/less.patch',
8 |
9 | child = grunt.util.spawn({
10 | cmd: 'lessc',
11 | args: ['--verbose', 'lib/build.less', 'tmp/'+filename]
12 | }, function() {
13 | var readFile = function(name) { return fs.readFileSync(name, {encoding: 'utf8'}) },
14 | orig = readFile(filename),
15 | generated = readFile('tmp/'+filename),
16 | patch = readFile(patchfile),
17 | diff = jsdiff.createPatch(filename, orig, generated);
18 |
19 | // Save the output for future tests.
20 | // fs.writeFileSync(patchfile, diff);
21 |
22 | t.equal(patch, diff);
23 | t.done();
24 | });
25 | };
--------------------------------------------------------------------------------
/test/scss_test.js:
--------------------------------------------------------------------------------
1 | exports.compileScss = function(test){
2 | var grunt = require('grunt'),
3 | fs = require('fs'),
4 | jsdiff = require('diff'),
5 | t = test,
6 | filename = 'select2-bootstrap.css',
7 | patchfile = 'test/support/scss.patch',
8 |
9 | child = grunt.util.spawn({
10 | cmd: 'grunt',
11 | args: ['sass:test']
12 | }, function() {
13 | var readFile = function(name) { return fs.readFileSync(name, {encoding: 'utf8'}) },
14 | orig = readFile(filename),
15 | generated = readFile('tmp/'+filename),
16 | patch = readFile(patchfile),
17 | diff = jsdiff.createPatch(filename, orig, generated);
18 |
19 | // Save the output for future tests.
20 | // fs.writeFileSync(patchfile, diff);
21 |
22 | t.equal(patch, diff);
23 | t.done();
24 | });
25 | };
--------------------------------------------------------------------------------
/test/support/less.patch:
--------------------------------------------------------------------------------
1 | Index: select2-bootstrap.css
2 | ===================================================================
3 | --- select2-bootstrap.css
4 | +++ select2-bootstrap.css
5 | @@ -1,4 +1,31 @@
6 | +.clearfix {
7 | + *zoom: 1;
8 | +}
9 | +.clearfix:before,
10 | +.clearfix:after {
11 | + display: table;
12 | + content: "";
13 | + line-height: 0;
14 | +}
15 | +.clearfix:after {
16 | + clear: both;
17 | +}
18 | +.hide-text {
19 | + font: 0/0 a;
20 | + color: transparent;
21 | + text-shadow: none;
22 | + background-color: transparent;
23 | + border: 0;
24 | +}
25 | +.input-block-level {
26 | + display: block;
27 | + width: 100%;
28 | + min-height: 30px;
29 | + -webkit-box-sizing: border-box;
30 | + -moz-box-sizing: border-box;
31 | + box-sizing: border-box;
32 | +}
33 | /**
34 | * Select2 Bootstrap CSS v1.2.5
35 | * Tested with Bootstrap v2.3.1, v2.3.2 and Select2 v3.3.2, v3.4.1
36 | * MIT License
37 | @@ -30,85 +57,73 @@
38 | .select2-container[class*="span"] {
39 | float: none;
40 | margin-left: 0;
41 | }
42 | -
43 | .select2-container .select2-choice,
44 | .select2-container-multi .select2-choices {
45 | height: 28px;
46 | line-height: 29px;
47 | + border: 1px solid #cccccc;
48 | - border: 1px solid #ccc;
49 | -webkit-border-radius: 4px;
50 | -moz-border-radius: 4px;
51 | border-radius: 4px;
52 | background: none;
53 | + background-color: #ffffff;
54 | - background-color: #fff;
55 | filter: none;
56 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
57 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
58 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
59 | }
60 | +.select2-container .select2-choice div,
61 | -
62 | -.select2-container .select2-choice div, .select2-container .select2-choice .select2-arrow,
63 | .select2-container.select2-container-disabled .select2-choice div,
64 | +.select2-container .select2-choice .select2-arrow,
65 | .select2-container.select2-container-disabled .select2-choice .select2-arrow {
66 | border-left: none;
67 | background: none;
68 | filter: none;
69 | }
70 | -
71 | .control-group.error [class^="select2-choice"] {
72 | border-color: #b94a48;
73 | }
74 | -
75 | .select2-container-multi .select2-choices .select2-search-field {
76 | height: 28px;
77 | line-height: 27px;
78 | }
79 | -
80 | .select2-drop.select2-drop-active,
81 | .select2-container-active .select2-choice,
82 | .select2-container-multi.select2-container-active .select2-choices {
83 | border-color: rgba(82, 168, 236, 0.8);
84 | border-color: #ccc\0;
85 | outline: none;
86 | }
87 | -
88 | .select2-container-active .select2-choice,
89 | .select2-container-multi.select2-container-active .select2-choices {
90 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
91 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
92 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
93 | }
94 | -
95 | [class^="input-"] .select2-container {
96 | font-size: 14px;
97 | }
98 | -
99 | .input-prepend [class^="select2-choice"] {
100 | border-top-left-radius: 0;
101 | border-bottom-left-radius: 0;
102 | }
103 | -
104 | .input-append [class^="select2-choice"] {
105 | border-top-right-radius: 0;
106 | border-bottom-right-radius: 0;
107 | }
108 | -
109 | .select2-dropdown-open [class^="select2-choice"] {
110 | border-bottom-left-radius: 0;
111 | border-bottom-right-radius: 0;
112 | }
113 | -
114 | .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
115 | border-top-left-radius: 0;
116 | border-top-right-radius: 0;
117 | }
118 | -
119 | [class^="input-"] .select2-offscreen {
120 | position: absolute;
121 | }
122 | -
123 | /**
124 | * This stops the quick flash when a native selectbox is shown and
125 | * then replaced by a select2 input when javascript kicks in. This can be
126 | * removed if javascript is not present
127 |
--------------------------------------------------------------------------------
/test/support/scss.patch:
--------------------------------------------------------------------------------
1 | Index: select2-bootstrap.css
2 | ===================================================================
3 | --- select2-bootstrap.css
4 | +++ select2-bootstrap.css
5 |
--------------------------------------------------------------------------------