Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions dist/select2-bootstrap4.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,42 +30,46 @@
color: #6c757d; }

.select2-container--bootstrap4 .select2-selection--multiple {
padding: 0 5px 0 5px;
min-height: calc(1.5em + 0.75rem + 2px) !important; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered {
-webkit-box-sizing: border-box;
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 8px;
width: 100%; }
padding: 0;
width: 100%;
white-space: normal; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered .select2-search__field {
width: 100% !important; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
color: #343a40;
border: 1px solid #bdc6d0;
border-radius: 0.2rem;
padding: 0;
padding-right: 5px;
padding: 0 5px 0 0;
cursor: pointer;
float: left;
display: inline-block;
margin-top: 0.3em;
margin-right: 5px; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove {
color: #bdc6d0;
color: #8193a5;
font-weight: bold;
margin-left: 3px;
margin-right: 1px;
padding-right: 3px;
padding-left: 3px;
float: left; }
margin-right: 5px;
padding: 0 5px;
float: left;
border: 1px solid transparent; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #343a40; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear {
color: #506070;
float: none;
margin-right: 0;
position: absolute !important;
top: 0;
right: 0.7em; }
right: 0.7em;
border: 1px solid transparent; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__clear:hover {
color: #343a40; }

.select2-container {
display: block; }
Expand Down Expand Up @@ -173,3 +177,4 @@ form.was-validated select:valid ~ .select2-container--bootstrap4 .select2-select
margin-right: 0.3em; }
.select2-container--bootstrap4 .select2-selection__clear:hover {
background-color: #afafaf; }

2 changes: 1 addition & 1 deletion dist/select2-bootstrap4.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
},
"homepage": "https://github.com/ttskch/select2-bootstrap4-theme#readme",
"devDependencies": {
"autoprefixer": "^9.4.2",
"bootstrap": "^4.1.3",
"css-loader": "^1.0.1",
"cssnano": "^4.1.7",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"node-sass": "^4.10.0",
"postcss": "^7.0.6",
"autoprefixer": "^9.8.4",
"bootstrap": "^4.5.0",
"css-loader": "^3.6.0",
"cssnano": "^4.1.10",
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.14.1",
"postcss": "^7.0.32",
"postcss-loader": "^3.0.0",
"precss": "^4.0.0",
"sass-loader": "^8.0.2",
"style-loader": "^0.23.1",
"webpack": "^4.27.0",
"webpack-cli": "^3.1.2"
"style-loader": "^1.2.1",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12"
},
"jsdelivr": "dist/select2-bootstrap4.min.css",
"browserslist": [
Expand Down
26 changes: 17 additions & 9 deletions src/_multiple.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.select2-container--bootstrap4 {
.select2-selection--multiple {

padding: 0 5px 0 5px;

// height of input box
min-height: $input-height !important;

Expand All @@ -9,8 +11,9 @@
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 8px;
padding: 0;
width: 100%;
white-space: normal;

.select2-search__field {
width: 100% !important;
Expand All @@ -22,23 +25,21 @@
color: $dark;
border: 1px solid darken($light, 20%);
@include border-radius($input-border-radius-sm);
padding: 0;
padding-right: 5px;
padding: 0 5px 0 0;
cursor: pointer;
float: left;
display: inline-block;
margin-top: 0.3em;
margin-right: 5px;
}

// x button of each selected item in input box
.select2-selection__choice__remove {
color: darken($light, 20%);
color: darken($light, 40%);
font-weight: bold;
margin-left: 3px;
margin-right: 1px;
padding-right: 3px;
padding-left: 3px;
margin-right: 5px;
padding: 0 5px;
float: left;
border: $btn-border-width solid transparent;

&:hover {
color: $dark;
Expand All @@ -48,12 +49,19 @@
// all clear button
.select2-selection__clear {
// overwrite layout.scss
color: darken($light, 60%);
float: none;
margin-right: 0;

position: absolute !important;
top: 0;
right: 0.7em;

border: $btn-border-width solid transparent;

&:hover {
color: $dark;
}
}
}
}
21 changes: 7 additions & 14 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
const path = require('path');

const ProvidePlugin = require('webpack/lib/ProvidePlugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

const isProd = process.env.NODE_ENV === 'production';

let plugins = [
new ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
Popper: ['popper.js', 'default'],
}),
new ExtractTextPlugin({
new MiniCssExtractPlugin({
filename: '[name]' + (isProd ? '.min' : '') + '.css',
allChunks: true,
}),
Expand All @@ -32,9 +25,10 @@ module.exports = {
rules: [
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
use: [
{
loader: MiniCssExtractPlugin.loader,
},
{
loader: 'css-loader',
},
Expand Down Expand Up @@ -66,8 +60,7 @@ module.exports = {
`
}
},
],
}),
]
},
],
},
Expand Down