Skip to content

Commit e656d5e

Browse files
committed
Fix for .form-control style conflicts (selectize#83).
1 parent 702926f commit e656d5e

10 files changed

Lines changed: 73 additions & 18 deletions

Gruntfile.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ module.exports = function(grunt) {
88
grunt.loadNpmTasks('grunt-contrib-copy');
99
grunt.loadNpmTasks('grunt-replace');
1010
grunt.loadNpmTasks('grunt-recess');
11-
grunt.registerTask('default', [
11+
12+
grunt.registerTask('configure', [
1213
'clean:pre',
1314
'bower:install',
15+
]);
16+
17+
grunt.registerTask('compile', [
1418
'copy:less',
1519
'copy:less_plugins',
1620
'concat:less_theme_dependencies',
@@ -24,6 +28,11 @@ module.exports = function(grunt) {
2428
'clean:post',
2529
]);
2630

31+
grunt.registerTask('default', [
32+
'configure',
33+
'compile'
34+
]);
35+
2736
grunt.registerTask('clean_bootstrap2_css', 'Cleans CSS rules ocurring before the header comment.', function() {
2837
var file = 'dist/css/selectize.bootstrap2.css';
2938
var source = fs.readFileSync(file, 'utf8');

dist/css/selectize.bootstrap2.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
.selectize-dropdown {
247247
position: absolute;
248248
z-index: 2;
249-
margin-top: -1px;
249+
margin: -1px 0 0 0;
250250
background: #ffffff;
251251
border: 1px solid #d0d0d0;
252252
border-top: 0 none;

dist/css/selectize.bootstrap3.css

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
.selectize-dropdown {
247247
position: absolute;
248248
z-index: 2;
249-
margin-top: -1px;
249+
margin: -1px 0 0 0;
250250
background: #ffffff;
251251
border: 1px solid #cccccc;
252252
border-top: 0 none;
@@ -341,12 +341,18 @@
341341
opacity: 0.5;
342342
}
343343

344-
.selectize-dropdown {
344+
.selectize-dropdown,
345+
.selectize-dropdown.form-control {
345346
z-index: 1000;
347+
height: auto;
348+
padding: 0;
346349
margin: 2px 0 0 0;
350+
background: #ffffff;
347351
border: 1px solid #cccccc;
348352
border: 1px solid rgba(0, 0, 0, 0.15);
349-
border-radius: 4px;
353+
-webkit-border-radius: 4px;
354+
-moz-border-radius: 4px;
355+
border-radius: 4px;
350356
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
351357
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
352358
}
@@ -409,4 +415,16 @@
409415
-webkit-border-radius: 3px;
410416
-moz-border-radius: 3px;
411417
border-radius: 3px;
418+
}
419+
420+
.form-control.selectize-control {
421+
height: auto;
422+
padding: 0;
423+
background: none;
424+
border: none;
425+
-webkit-border-radius: 0;
426+
-moz-border-radius: 0;
427+
border-radius: 0;
428+
-webkit-box-shadow: none;
429+
box-shadow: none;
412430
}

dist/css/selectize.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
.selectize-dropdown {
247247
position: absolute;
248248
z-index: 2;
249-
margin-top: -1px;
249+
margin: -1px 0 0 0;
250250
background: #ffffff;
251251
border: 1px solid #d0d0d0;
252252
border-top: 0 none;

dist/css/selectize.default.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
.selectize-dropdown {
247247
position: absolute;
248248
z-index: 2;
249-
margin-top: -1px;
249+
margin: -1px 0 0 0;
250250
background: #ffffff;
251251
border: 1px solid #d0d0d0;
252252
border-top: 0 none;

dist/css/selectize.legacy.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
.selectize-dropdown {
247247
position: absolute;
248248
z-index: 2;
249-
margin-top: -1px;
249+
margin: -1px 0 0 0;
250250
background: #ffffff;
251251
border: 1px solid #d0d0d0;
252252
border-top: 0 none;

dist/less/selectize.bootstrap3.less

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,19 @@
5959
@selectize-arrow-color: @dropdown-caret-color;
6060
@selectize-arrow-offset: @selectize-padding-x + 5px;
6161

62-
.selectize-dropdown {
62+
.selectize-dropdown, .selectize-dropdown.form-control {
63+
height: auto;
64+
padding: 0;
6365
margin: 2px 0 0 0;
6466
z-index: @zindex-dropdown;
67+
background: @selectize-color-dropdown;
6568
border: 1px solid @dropdown-fallback-border;
6669
border: 1px solid @dropdown-border;
67-
border-radius: @border-radius-base;
68-
.box-shadow(0 6px 12px rgba(0,0,0,.175));
70+
.selectize-border-radius(@border-radius-base);
71+
.selectize-box-shadow(0 6px 12px rgba(0,0,0,.175));
72+
}
6973

74+
.selectize-dropdown {
7075
.optgroup-header {
7176
font-size: @font-size-small;
7277
line-height: @line-height-base;
@@ -105,7 +110,7 @@
105110
@color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
106111
border-color: @color;
107112
outline: 0;
108-
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
113+
.selectize-box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
109114
}
110115
}
111116

@@ -119,4 +124,13 @@
119124
.selectize-border-radius(@selectize-border-radius - 1px);
120125
}
121126
}
127+
}
128+
129+
.form-control.selectize-control {
130+
padding: 0;
131+
height: auto;
132+
border: none;
133+
background: none;
134+
.selectize-box-shadow(none);
135+
.selectize-border-radius(0);
122136
}

dist/less/selectize.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
z-index: 2;
207207
border: @selectize-border;
208208
background: @selectize-color-dropdown;
209-
margin-top: -1px;
209+
margin: -1px 0 0 0;
210210
border-top: 0 none;
211211
.selectize-box-sizing(border-box);
212212
.selectize-box-shadow(0 1px 3px rgba(0,0,0,0.1));

src/less/selectize.bootstrap3.less

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,19 @@
5959
@selectize-arrow-color: @dropdown-caret-color;
6060
@selectize-arrow-offset: @selectize-padding-x + 5px;
6161

62-
.selectize-dropdown {
62+
.selectize-dropdown, .selectize-dropdown.form-control {
63+
height: auto;
64+
padding: 0;
6365
margin: 2px 0 0 0;
6466
z-index: @zindex-dropdown;
67+
background: @selectize-color-dropdown;
6568
border: 1px solid @dropdown-fallback-border;
6669
border: 1px solid @dropdown-border;
67-
border-radius: @border-radius-base;
68-
.box-shadow(0 6px 12px rgba(0,0,0,.175));
70+
.selectize-border-radius(@border-radius-base);
71+
.selectize-box-shadow(0 6px 12px rgba(0,0,0,.175));
72+
}
6973

74+
.selectize-dropdown {
7075
.optgroup-header {
7176
font-size: @font-size-small;
7277
line-height: @line-height-base;
@@ -105,7 +110,7 @@
105110
@color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
106111
border-color: @color;
107112
outline: 0;
108-
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
113+
.selectize-box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
109114
}
110115
}
111116

@@ -119,4 +124,13 @@
119124
.selectize-border-radius(@selectize-border-radius - 1px);
120125
}
121126
}
127+
}
128+
129+
.form-control.selectize-control {
130+
padding: 0;
131+
height: auto;
132+
border: none;
133+
background: none;
134+
.selectize-box-shadow(none);
135+
.selectize-border-radius(0);
122136
}

src/less/selectize.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
z-index: 2;
202202
border: @selectize-border;
203203
background: @selectize-color-dropdown;
204-
margin-top: -1px;
204+
margin: -1px 0 0 0;
205205
border-top: 0 none;
206206
.selectize-box-sizing(border-box);
207207
.selectize-box-shadow(0 1px 3px rgba(0,0,0,0.1));

0 commit comments

Comments
 (0)