diff --git a/CHANGELOG.md b/CHANGELOG.md index e9ca66c9..d6e755a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 3.4 + +- Full Bootstrap 4 integration of CSS + sources SASS/SCSS + ## 3.3.4 - Fix Object.assign not working for IE <= 11 [#616](https://github.com/Bttstrp/bootstrap-switch/issues/616) diff --git a/README.md b/README.md index f0bf364d..d9e44653 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ [![NPM Version](http://img.shields.io/npm/v/bootstrap-switch.svg?style=flat)](https://www.npmjs.org/) Turn checkboxes and radio buttons into toggle switches. Created by [Mattia Larentis](http://github.com/nostalgiaz), maintained by [Emanuele Marchi](http://github.com/lostcrew) and [Peter Stein](http://www.bdmdesign.org) with the help of the community. +Compatible with Bootstrap 4, Bootstrap 3 and Bootstrap 2. + +Play with [demo on my fiddle](https://jsfiddle.net/djibe89/vL87w0j8/). ## Quick start @@ -49,6 +52,10 @@ IE9+ and all the other modern browsers. - For Bootstrap 2 (no longer officially supported), import `src/less/bootstrap2/bootstrap-switch.less` - For Bootstrap 3, import `src/less/bootstrap3/bootstrap-switch.less` +## SASS/SCSS + +- For Bootstrap 4, import `src/sass/bootstrap4/bootstrap-switch.scss` + ## Bugs and feature requests Have a bug or a feature request? Please first search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/Bttstrp/bootstrap-switch/issues/new). diff --git a/dist/css/bootstrap4/bootstrap-switch-pktheme.css b/dist/css/bootstrap4/bootstrap-switch-pktheme.css new file mode 100644 index 00000000..c4c3eb83 --- /dev/null +++ b/dist/css/bootstrap4/bootstrap-switch-pktheme.css @@ -0,0 +1,250 @@ +/** + * bootstrap-switch paperkit theme - Turn checkboxes and radio buttons into toggle switches. + * + * @version v3.4 for Bootstrap 4.x + * @homepage https://bttstrp.github.io/bootstrap-switch + * @author Mattia Larentis (http://larentis.eu) + * & djibe + * @license Apache-2.0 + */ +.bootstrap-switch { + display: inline-block; + direction: ltr; + cursor: pointer; + border-radius: 30px; + border: 0; + position: relative; + text-align: left; + height: 26px; + outline: none; + overflow: hidden; + line-height: 8px; + width: 61px !important; + z-index: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + vertical-align: middle; + -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + margin-bottom: 5px; + margin-right: 1px; +} +.bootstrap-switch .bootstrap-switch-container { + display: -webkit-inline-box; + display: -ms-inline-flexbox; + display: inline-flex; + height: 26px; + top: 0; + border-radius: 30px; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + width: 100px !important; +} +.bootstrap-switch .bootstrap-switch-handle-on, +.bootstrap-switch .bootstrap-switch-handle-off, +.bootstrap-switch .bootstrap-switch-label { + -webkit-box-sizing: border-box; + box-sizing: border-box; + cursor: pointer; + display: inline-block !important; + height: 100%; + color: #fff; + vertical-align: middle; + padding: 6px 12px; + font-size: 11px; + text-indent: -5px; + line-height: 15px; + -webkit-transition: 0.25s ease-out; + transition: 0.25s ease-out; +} +.bootstrap-switch .bootstrap-switch-handle-on i, +.bootstrap-switch .bootstrap-switch-handle-off i, +.bootstrap-switch .bootstrap-switch-label i { + font-size: 12px; + line-height: 14px; +} +.bootstrap-switch .bootstrap-switch-handle-on, +.bootstrap-switch .bootstrap-switch-handle-off { + text-align: center; + z-index: 1; + float: left; + width: 50% !important; + background-color: #66615b; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary { + background: #51cbce; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default { + background: #cfcfca; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary { + background: #66615b; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info { + background: #51bcda; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success { + background: #6bd098; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning { + background: #fbc658; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger { + background: #f5593d; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-label { + border-radius: 12px; + position: relative; + text-align: center; + float: left; + margin: 2px -11px; + z-index: 100; + color: #333; + background: #fff; + width: 22px !important; + height: 22px; + padding: 0; + -webkit-box-shadow: 0 1px 1px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 1px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.25); +} +.bootstrap-switch span::before { + content: "\200b"; +} +.bootstrap-switch .bootstrap-switch-handle-on { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} +.bootstrap-switch .bootstrap-switch-handle-off { + text-indent: 6px; +} +.bootstrap-switch input[type='radio'], +.bootstrap-switch input[type='checkbox'] { + position: absolute !important; + top: 0; + left: 0; + margin: 0; + z-index: -1; + opacity: 0; + filter: alpha(opacity=0); + visibility: hidden; +} +.bootstrap-switch input[type='radio'].form-control, +.bootstrap-switch input[type='checkbox'].form-control { + height: auto; +} +.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on, +.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off, +.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; +} +.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on, +.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off, +.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; +} +.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on, +.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off, +.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label { + padding: 6px 16px; + font-size: 18px; + line-height: 1.33; +} +.bootstrap-switch.bootstrap-switch-disabled, .bootstrap-switch.bootstrap-switch-readonly, .bootstrap-switch.bootstrap-switch-indeterminate { + cursor: default !important; +} +.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on, .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on, .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on, .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off, .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off, .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off, .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label { + opacity: 0.5; + filter: alpha(opacity=50); + cursor: default !important; +} +.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container { + -webkit-transition: margin-left 0.5s; + transition: margin-left 0.5s; +} +.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on { + border-radius: 0 3px 3px 0; +} +.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off { + border-radius: 3px 0 0 3px; +} +.bootstrap-switch.bootstrap-switch-focused { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label { + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; +} +.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} +.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-container { + margin-left: -2px !important; +} +.bootstrap-switch.bootstrap-switch-on:hover .bootstrap-switch-label { + width: 26px !important; + margin: 2px -15px; +} +.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-handle-off { + background: #66615b; +} +.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-danger { + background-color: #f5593d; +} +.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-warning { + background-color: #fbc658; +} +.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-success { + background-color: #6bd098; +} +.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-primary { + background-color: #51cbce; +} +.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-secondary { + background-color: #66615b; +} +.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-info { + background-color: #51bcda; +} +.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-container { + margin-left: -37px !important; +} +.bootstrap-switch.bootstrap-switch-off:hover .bootstrap-switch-label { + width: 26px !important; + margin: 2px -15px -13px -11px; +} +.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-danger, +.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-primary, +.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-info, +.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-warning, +.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-success { + background-color: #cfcfca; +} +.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-handle-on { + background-color: #cfcfca; +} diff --git a/dist/css/bootstrap4/bootstrap-switch-pktheme.min.css b/dist/css/bootstrap4/bootstrap-switch-pktheme.min.css new file mode 100644 index 00000000..f98536ce --- /dev/null +++ b/dist/css/bootstrap4/bootstrap-switch-pktheme.min.css @@ -0,0 +1 @@ +.bootstrap-switch{display:inline-block;direction:ltr;cursor:pointer;border-radius:30px;border:0;position:relative;text-align:left;height:26px;outline:0;overflow:hidden;line-height:8px;width:61px!important;z-index:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;margin-bottom:5px;margin-right:1px}.bootstrap-switch .bootstrap-switch-container{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;height:26px;top:0;border-radius:30px;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);width:100px!important}.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-label{-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:inline-block!important;height:100%;color:#fff;vertical-align:middle;padding:6px 12px;font-size:11px;text-indent:-5px;line-height:15px;-webkit-transition:.25s ease-out;transition:.25s ease-out}.bootstrap-switch .bootstrap-switch-handle-off i,.bootstrap-switch .bootstrap-switch-handle-on i,.bootstrap-switch .bootstrap-switch-label i{font-size:12px;line-height:14px}.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-handle-on{text-align:center;z-index:1;float:left;width:50%!important;background-color:#66615b}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary{background:#51cbce;color:#fff}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default{background:#cfcfca;color:#fff}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary{background:#66615b;color:#fff}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info{background:#51bcda;color:#fff}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success{background:#6bd098;color:#fff}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning{background:#fbc658;color:#fff}.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger{background:#f5593d;color:#fff}.bootstrap-switch .bootstrap-switch-label{border-radius:12px;position:relative;text-align:center;float:left;margin:2px -11px;z-index:100;color:#333;background:#fff;width:22px!important;height:22px;padding:0;-webkit-box-shadow:0 1px 1px #fff inset,0 1px 1px rgba(0,0,0,.25);box-shadow:0 1px 1px #fff inset,0 1px 1px rgba(0,0,0,.25)}.bootstrap-switch span::before{content:"\200b"}.bootstrap-switch .bootstrap-switch-handle-on{border-bottom-left-radius:3px;border-top-left-radius:3px}.bootstrap-switch .bootstrap-switch-handle-off{text-indent:6px}.bootstrap-switch input[type=checkbox],.bootstrap-switch input[type=radio]{position:absolute!important;top:0;left:0;margin:0;z-index:-1;opacity:0;visibility:hidden}.bootstrap-switch input[type=checkbox].form-control,.bootstrap-switch input[type=radio].form-control{height:auto}.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label{padding:1px 5px;font-size:12px;line-height:1.5}.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label{padding:5px 10px;font-size:12px;line-height:1.5}.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label{padding:6px 16px;font-size:18px;line-height:1.33}.bootstrap-switch.bootstrap-switch-disabled,.bootstrap-switch.bootstrap-switch-indeterminate,.bootstrap-switch.bootstrap-switch-readonly{cursor:default!important}.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label{opacity:.5;cursor:default!important}.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container{-webkit-transition:margin-left .5s;transition:margin-left .5s}.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on{border-radius:0 3px 3px 0}.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off{border-radius:3px 0 0 3px}.bootstrap-switch.bootstrap-switch-focused{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label{border-bottom-left-radius:3px;border-top-left-radius:3px}.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-container{margin-left:-2px!important}.bootstrap-switch.bootstrap-switch-on:hover .bootstrap-switch-label{width:26px!important;margin:2px -15px}.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-handle-off{background:#66615b}.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-danger{background-color:#f5593d}.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-warning{background-color:#fbc658}.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-success{background-color:#6bd098}.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-primary{background-color:#51cbce}.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-secondary{background-color:#66615b}.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-info{background-color:#51bcda}.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-container{margin-left:-37px!important}.bootstrap-switch.bootstrap-switch-off:hover .bootstrap-switch-label{width:26px!important;margin:2px -15px -13px -11px}.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-danger,.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-info,.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-primary,.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-success,.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-warning{background-color:#cfcfca}.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-handle-on{background-color:#cfcfca} \ No newline at end of file diff --git a/dist/css/bootstrap4/bootstrap-switch.css b/dist/css/bootstrap4/bootstrap-switch.css new file mode 100644 index 00000000..ff1d18fa --- /dev/null +++ b/dist/css/bootstrap4/bootstrap-switch.css @@ -0,0 +1,174 @@ +/** + * bootstrap-switch - Turn checkboxes and radio buttons into toggle switches. + * + * @version v3.4 for Bootstrap 4.x + * @homepage https://bttstrp.github.io/bootstrap-switch + * @author Mattia Larentis (http://larentis.eu) + * & djibe + * @license Apache-2.0 + */ +.bootstrap-switch { + display: inline-block; + direction: ltr; + cursor: pointer; + border-radius: 4px; + border: 1px solid #ccc; + position: relative; + text-align: left; + overflow: hidden; + line-height: 8px; + z-index: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + vertical-align: middle; + -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; +} +.bootstrap-switch .bootstrap-switch-container { + display: inline-block; + top: 0; + border-radius: 4px; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} +.bootstrap-switch .bootstrap-switch-handle-on, +.bootstrap-switch .bootstrap-switch-handle-off, +.bootstrap-switch .bootstrap-switch-label { + -webkit-box-sizing: border-box; + box-sizing: border-box; + cursor: pointer; + display: table-cell; + vertical-align: middle; + padding: 6px 12px; + font-size: 14px; + line-height: 20px; + font-weight: 500; +} +.bootstrap-switch .bootstrap-switch-handle-on, +.bootstrap-switch .bootstrap-switch-handle-off { + text-align: center; + z-index: 1; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary { + background: #007bff; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default { + background: #eee; + color: rgba(0, 0, 0, 0.87); +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary { + background: #6c757d; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info { + background: #17a2b8; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success { + background: #28a745; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning { + background: #ffc107; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger, +.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger { + background: #dc3545; + color: #fff; +} +.bootstrap-switch .bootstrap-switch-label { + text-align: center; + margin-top: -1px; + margin-bottom: -1px; + z-index: 100; + color: #333; + background: #fff; + padding: 8px 12px; +} +.bootstrap-switch span::before { + content: "\200b"; +} +.bootstrap-switch .bootstrap-switch-handle-on { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} +.bootstrap-switch .bootstrap-switch-handle-off { + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; +} +.bootstrap-switch input[type='radio'], +.bootstrap-switch input[type='checkbox'] { + position: absolute !important; + top: 0; + left: 0; + margin: 0; + z-index: -1; + opacity: 0; + filter: alpha(opacity=0); + visibility: hidden; +} +.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on, +.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off, +.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; +} +.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on, +.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off, +.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; +} +.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on, +.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off, +.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label { + padding: 6px 16px; + font-size: 18px; + line-height: 1.3333333; +} +.bootstrap-switch.bootstrap-switch-disabled, .bootstrap-switch.bootstrap-switch-readonly, .bootstrap-switch.bootstrap-switch-indeterminate { + cursor: default !important; +} +.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on, .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on, .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on, .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off, .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off, .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off, .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label { + opacity: 0.5; + filter: alpha(opacity=50); + cursor: default !important; +} +.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container { + -webkit-transition: margin-left 0.5s; + transition: margin-left 0.5s; +} +.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on { + border-radius: 0 3px 3px 0; +} +.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off { + border-radius: 3px 0 0 3px; +} +.bootstrap-switch.bootstrap-switch-focused { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label { + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; +} +.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} diff --git a/dist/css/bootstrap4/bootstrap-switch.min.css b/dist/css/bootstrap4/bootstrap-switch.min.css new file mode 100644 index 00000000..6350fef9 --- /dev/null +++ b/dist/css/bootstrap4/bootstrap-switch.min.css @@ -0,0 +1 @@ +.bootstrap-switch{display:inline-block;direction:ltr;cursor:pointer;border-radius:4px;border:1px solid #ccc;position:relative;text-align:left;overflow:hidden;line-height:8px;z-index:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s, -webkit-box-shadow ease-in-out .15s}.bootstrap-switch .bootstrap-switch-container{display:inline-block;top:0;border-radius:4px;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-label{-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:table-cell;vertical-align:middle;padding:6px 12px;font-size:14px;line-height:20px;font-weight:500}.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-handle-off{text-align:center;z-index:1}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary{background:#007bff;color:#fff}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default{background:#eee;color:rgba(0,0,0,0.87)}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary{background:#6c757d;color:#fff}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info{background:#17a2b8;color:#fff}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success{background:#28a745;color:#fff}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning{background:#ffc107;color:#fff}.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger{background:#dc3545;color:#fff}.bootstrap-switch .bootstrap-switch-label{text-align:center;margin-top:-1px;margin-bottom:-1px;z-index:100;color:#333;background:#fff;padding:8px 12px}.bootstrap-switch span::before{content:"\200b"}.bootstrap-switch .bootstrap-switch-handle-on{border-bottom-left-radius:3px;border-top-left-radius:3px}.bootstrap-switch .bootstrap-switch-handle-off{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch input[type='radio'],.bootstrap-switch input[type='checkbox']{position:absolute !important;top:0;left:0;margin:0;z-index:-1;opacity:0;filter:alpha(opacity=0);visibility:hidden}.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label{padding:1px 5px;font-size:12px;line-height:1.5}.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label{padding:5px 10px;font-size:12px;line-height:1.5}.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label{padding:6px 16px;font-size:18px;line-height:1.3333333}.bootstrap-switch.bootstrap-switch-disabled,.bootstrap-switch.bootstrap-switch-readonly,.bootstrap-switch.bootstrap-switch-indeterminate{cursor:default !important}.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label{opacity:0.5;filter:alpha(opacity=50);cursor:default !important}.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container{-webkit-transition:margin-left 0.5s;transition:margin-left 0.5s}.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on{border-radius:0 3px 3px 0}.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off{border-radius:3px 0 0 3px}.bootstrap-switch.bootstrap-switch-focused{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label{border-bottom-right-radius:3px;border-top-right-radius:3px}.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label,.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label{border-bottom-left-radius:3px;border-top-left-radius:3px} diff --git a/package.json b/package.json index f735166e..680500bd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bootstrap-switch", "description": "Turn checkboxes and radio buttons into toggle switches.", - "version": "3.3.5", + "version": "3.4", "keywords": [ "bootstrap", "switch", @@ -16,7 +16,7 @@ ], "main": "dist/js/bootstrap-switch.js", "peerDependencies": { - "bootstrap": "^3.3.7", + "bootstrap": "^4.3.1", "jquery": ">=1.12.4" }, "repository": { diff --git a/src/sass/bootstrap4/bootstrap-switch-pktheme.scss b/src/sass/bootstrap4/bootstrap-switch-pktheme.scss new file mode 100644 index 00000000..58856d61 --- /dev/null +++ b/src/sass/bootstrap4/bootstrap-switch-pktheme.scss @@ -0,0 +1,303 @@ +/** + * bootstrap-switch paperkit theme - Turn checkboxes and radio buttons into toggle switches. + * + * @version v3.4 for Bootstrap 4.x + * @homepage https://bttstrp.github.io/bootstrap-switch + * @author Mattia Larentis (http://larentis.eu) + * & djibe + * @license Apache-2.0 + */ + +$bootstrap-switch-border-radius: 30px; +$bootstrap-switch-handle-border-radius: 3px; + +@import "../bootstrap-4.3.1/functions"; +@import "../updated-paperkit2/variables-paperkit2"; + +.bootstrap-switch { + display: inline-block; + direction: ltr; + cursor: pointer; + border-radius: $bootstrap-switch-border-radius; + border: 0; + position: relative; + text-align: left; + height: 26px; + outline: none; + overflow: hidden; + line-height: 8px; + width: 61px !important; + z-index: 0; + user-select: none; + vertical-align: middle; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + margin-bottom: 5px; + margin-right: 1px; + + .bootstrap-switch-container { + display: inline-flex; + height: 26px; + top: 0; + border-radius: $bootstrap-switch-border-radius; + transform: translate3d(0, 0, 0); + width: 100px !important; + } + + .bootstrap-switch-handle-on, + .bootstrap-switch-handle-off, + .bootstrap-switch-label { + box-sizing: border-box; + cursor: pointer; + display: inline-block !important; + height: 100%; + color: #fff; + vertical-align: middle; + padding: 6px 12px; + font-size: 11px; + text-indent: -5px; + line-height: 15px; + transition: 0.25s ease-out; + + i { + font-size: 12px; + line-height: 14px; + } + } + + .bootstrap-switch-handle-on, + .bootstrap-switch-handle-off { + text-align: center; + z-index: 1; + float: left; + width: 50% !important; + background-color: $secondary; + + &.bootstrap-switch-primary { + background: $primary; + color: #fff; + } + + &.bootstrap-switch-default { + background: #cfcfca; + color: #fff; + } + + &.bootstrap-switch-secondary { + background: $secondary; + color: #fff; + } + + &.bootstrap-switch-info { + background: $info; + color: #fff; + } + + &.bootstrap-switch-success { + background: $success; + color: #fff; + } + + &.bootstrap-switch-warning { + background: $warning; + color: #fff; + } + + &.bootstrap-switch-danger { + background: $danger; + color: #fff; + } + } + + .bootstrap-switch-label { + border-radius: 12px; + position: relative; + text-align: center; + float: left; + margin: 2px -11px; + z-index: 100; + color: #333; + background: #fff; + width: 22px !important; + height: 22px; + padding: 0; + box-shadow: 0 1px 1px #fff inset, 0 1px 1px rgba(0, 0, 0, .25); + } + + span::before { + content: "\200b"; + } + + .bootstrap-switch-handle-on { + border-bottom-left-radius: $bootstrap-switch-handle-border-radius; + border-top-left-radius: $bootstrap-switch-handle-border-radius; + } + + .bootstrap-switch-handle-off { + text-indent: 6px; + } + + input[type='radio'], + input[type='checkbox'] { + position: absolute !important; + top: 0; + left: 0; + margin: 0; + z-index: -1; + opacity: 0; + filter: alpha(opacity=0); + visibility: hidden; + + &.form-control { + height: auto; + } + } + + &.bootstrap-switch-mini { + + .bootstrap-switch-handle-on, + .bootstrap-switch-handle-off, + .bootstrap-switch-label { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + } + } + + &.bootstrap-switch-small { + + .bootstrap-switch-handle-on, + .bootstrap-switch-handle-off, + .bootstrap-switch-label { + + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + } + } + + &.bootstrap-switch-large { + + .bootstrap-switch-handle-on, + .bootstrap-switch-handle-off, + .bootstrap-switch-label { + padding: 6px 16px; + font-size: 18px; + line-height: 1.33; + } + } + + &.bootstrap-switch-disabled, + &.bootstrap-switch-readonly, + &.bootstrap-switch-indeterminate { + cursor: default !important; + } + + &.bootstrap-switch-disabled .bootstrap-switch-handle-on, + &.bootstrap-switch-readonly .bootstrap-switch-handle-on, + &.bootstrap-switch-indeterminate .bootstrap-switch-handle-on, + &.bootstrap-switch-disabled .bootstrap-switch-handle-off, + &.bootstrap-switch-readonly .bootstrap-switch-handle-off, + &.bootstrap-switch-indeterminate .bootstrap-switch-handle-off, + &.bootstrap-switch-disabled .bootstrap-switch-label, + &.bootstrap-switch-readonly .bootstrap-switch-label, + &.bootstrap-switch-indeterminate .bootstrap-switch-label { + opacity: 0.5; + filter: alpha(opacity=50); + cursor: default !important; + } + + &.bootstrap-switch-animate .bootstrap-switch-container { + transition: margin-left 0.5s; + } + + &.bootstrap-switch-inverse { + .bootstrap-switch-handle-on { + border-radius: 0 $bootstrap-switch-handle-border-radius $bootstrap-switch-handle-border-radius 0; + } + + .bootstrap-switch-handle-off { + border-radius: $bootstrap-switch-handle-border-radius 0 0 $bootstrap-switch-handle-border-radius; + } + } + + &.bootstrap-switch-focused { + border-color: #66afe9; + outline: 0; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, 0.6); + } + + &.bootstrap-switch-on .bootstrap-switch-label, + &.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label { + border-bottom-right-radius: $bootstrap-switch-handle-border-radius; + border-top-right-radius: $bootstrap-switch-handle-border-radius; + } + + &.bootstrap-switch-off .bootstrap-switch-label, + &.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label { + border-bottom-left-radius: $bootstrap-switch-handle-border-radius; + border-top-left-radius: $bootstrap-switch-handle-border-radius; + } + + // additions + &.bootstrap-switch-on { + .bootstrap-switch-container { + margin-left: -2px !important; + } + + &:hover .bootstrap-switch-label { + width: 26px !important; + margin: 2px -15px; + } + + .bootstrap-switch-handle-off { + background: $secondary; + } + + .bootstrap-switch-danger { + background-color: $danger; + } + + .bootstrap-switch-warning { + background-color: $warning; + } + + .bootstrap-switch-success { + background-color: $success; + } + + .bootstrap-switch-primary { + background-color: $primary; + } + + .bootstrap-switch-secondary { + background-color: $secondary; + } + + .bootstrap-switch-info { + background-color: $info; + } + } + + &.bootstrap-switch-off { + .bootstrap-switch-container { + margin-left: -37px !important; + } + + &:hover .bootstrap-switch-label { + width: 26px !important; + margin: 2px -15px -13px -11px; + } + + .bootstrap-switch-danger, + .bootstrap-switch-primary, + .bootstrap-switch-info, + .bootstrap-switch-warning, + .bootstrap-switch-success { + background-color: #cfcfca; + } + + .bootstrap-switch-handle-on { + background-color: #cfcfca; + } + } +} \ No newline at end of file diff --git a/src/sass/bootstrap4/bootstrap-switch.scss b/src/sass/bootstrap4/bootstrap-switch.scss new file mode 100644 index 00000000..63d99511 --- /dev/null +++ b/src/sass/bootstrap4/bootstrap-switch.scss @@ -0,0 +1,214 @@ +/** + * bootstrap-switch - Turn checkboxes and radio buttons into toggle switches. + * + * @version v3.4 for Bootstrap 4.x + * @homepage https://bttstrp.github.io/bootstrap-switch + * @author Mattia Larentis (http://larentis.eu) + * & djibe + * @license Apache-2.0 + */ + +$bootstrap-switch-border-radius: 4px; +$bootstrap-switch-handle-border-radius: 3px; + +@import "../bootstrap-4.2.1/functions"; +@import "../bootstrap-4.2.1/variables"; + +.bootstrap-switch { + display: inline-block; + direction: ltr; + cursor: pointer; + border-radius: $bootstrap-switch-border-radius; + border: 1px solid #ccc; + position: relative; + text-align: left; + overflow: hidden; + line-height: 8px; + z-index: 0; + user-select: none; + vertical-align: middle; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + + .bootstrap-switch-container { + display: inline-block; + top: 0; + border-radius: $bootstrap-switch-border-radius; + transform: translate3d(0, 0, 0); + } + + .bootstrap-switch-handle-on, + .bootstrap-switch-handle-off, + .bootstrap-switch-label { + box-sizing: border-box; + cursor: pointer; + display: table-cell; + vertical-align: middle; + padding: 6px 12px; + font-size: 14px; + line-height: 20px; + font-weight: 500; + } + + .bootstrap-switch-handle-on, + .bootstrap-switch-handle-off { + text-align: center; + z-index: 1; + + &.bootstrap-switch-primary { + background: $primary; + color: #fff; + } + + &.bootstrap-switch-default { + background: #eee; + color: rgba(0, 0, 0, .87); + } + + &.bootstrap-switch-secondary { + background: $secondary; + color: #fff; + } + + &.bootstrap-switch-info { + background: $info; + color: #fff; + } + + &.bootstrap-switch-success { + background: $success; + color: #fff; + } + + &.bootstrap-switch-warning { + background: $warning; + color: #fff; + } + + &.bootstrap-switch-danger { + background: $danger; + color: #fff; + } + } + + .bootstrap-switch-label { + text-align: center; + margin-top: -1px; + margin-bottom: -1px; + z-index: 100; + color: #333; + background: #fff; + padding: 8px 12px; //test https://github.com/Bttstrp/bootstrap-switch/issues/693 + } + + span::before { + content: "\200b"; + } + + .bootstrap-switch-handle-on { + border-bottom-left-radius: $bootstrap-switch-handle-border-radius; + border-top-left-radius: $bootstrap-switch-handle-border-radius; + } + + .bootstrap-switch-handle-off { + border-bottom-right-radius: $bootstrap-switch-handle-border-radius; + border-top-right-radius: $bootstrap-switch-handle-border-radius; + } + + input[type='radio'], + input[type='checkbox'] { + position: absolute !important; + top: 0; + left: 0; + margin: 0; + z-index: -1; + opacity: 0; + filter: alpha(opacity=0); + visibility: hidden; + } + + &.bootstrap-switch-mini { + + .bootstrap-switch-handle-on, + .bootstrap-switch-handle-off, + .bootstrap-switch-label { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + } + } + + &.bootstrap-switch-small { + + .bootstrap-switch-handle-on, + .bootstrap-switch-handle-off, + .bootstrap-switch-label { + + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + } + } + + &.bootstrap-switch-large { + + .bootstrap-switch-handle-on, + .bootstrap-switch-handle-off, + .bootstrap-switch-label { + padding: 6px 16px; + font-size: 18px; + line-height: 1.3333333; + } + } + + &.bootstrap-switch-disabled, + &.bootstrap-switch-readonly, + &.bootstrap-switch-indeterminate { + cursor: default !important; + } + + &.bootstrap-switch-disabled .bootstrap-switch-handle-on, + &.bootstrap-switch-readonly .bootstrap-switch-handle-on, + &.bootstrap-switch-indeterminate .bootstrap-switch-handle-on, + &.bootstrap-switch-disabled .bootstrap-switch-handle-off, + &.bootstrap-switch-readonly .bootstrap-switch-handle-off, + &.bootstrap-switch-indeterminate .bootstrap-switch-handle-off, + &.bootstrap-switch-disabled .bootstrap-switch-label, + &.bootstrap-switch-readonly .bootstrap-switch-label, + &.bootstrap-switch-indeterminate .bootstrap-switch-label { + opacity: 0.5; + filter: alpha(opacity=50); + cursor: default !important; + } + + &.bootstrap-switch-animate .bootstrap-switch-container { + transition: margin-left 0.5s; + } + + &.bootstrap-switch-inverse { + .bootstrap-switch-handle-on { + border-radius: 0 $bootstrap-switch-handle-border-radius $bootstrap-switch-handle-border-radius 0; + } + + .bootstrap-switch-handle-off { + border-radius: $bootstrap-switch-handle-border-radius 0 0 $bootstrap-switch-handle-border-radius; + } + } + + &.bootstrap-switch-focused { + border-color: #66afe9; + outline: 0; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, 0.6); + } + + &.bootstrap-switch-on .bootstrap-switch-label, + &.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label { + border-bottom-right-radius: $bootstrap-switch-handle-border-radius; + border-top-right-radius: $bootstrap-switch-handle-border-radius; + } + + &.bootstrap-switch-off .bootstrap-switch-label, + &.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label { + border-bottom-left-radius: $bootstrap-switch-handle-border-radius; + border-top-left-radius: $bootstrap-switch-handle-border-radius; + } +}