diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-08-23 12:17:01 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-08-23 16:45:40 +0200 |
| commit | 9fc771dd5d1e023978d7b4691126ba3bcedc19d8 (patch) | |
| tree | 00cfb849370827d78ef78b5a0ee30d89bd27918c /addons/web/static/src/scss/webclient.scss | |
| parent | 6fd68c28cde6e2cf4994de5893bb004cc0476690 (diff) | |
[FIX] web: BS4, restore slider checkboxes
Take advantage of the new BS4 checkbox structure to simplify the
widget too.
Diffstat (limited to 'addons/web/static/src/scss/webclient.scss')
| -rw-r--r-- | addons/web/static/src/scss/webclient.scss | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/addons/web/static/src/scss/webclient.scss b/addons/web/static/src/scss/webclient.scss index 7b7162d986a..3c8df0c912b 100644 --- a/addons/web/static/src/scss/webclient.scss +++ b/addons/web/static/src/scss/webclient.scss @@ -73,43 +73,43 @@ } // Boolean Toggle widget -div.o_boolean_toggle { - position: relative; - display: inline-block; - width: 32px !important; - height: 18px; +div.o_boolean_toggle.custom-control.custom-checkbox { + $line-height-computed: $line-height-base * $font-size-base; + $slider-width: $line-height-computed * 1.5; + $circle-width: $line-height-computed * 0.6; - > input { - display: none; - } + display: inline-block; + padding-left: $slider-width + 0.25rem; - .slider { - position: absolute; - cursor: pointer; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: #a0a0a0; - border-radius: 24px; - - &:before { - position: absolute; + > label.custom-control-label { + &::before, &::after { content: ""; - height: 12px; - width: 12px; - left: 3px; - bottom: 3px; - background-color: white; - border-radius: 50%; + top: 0; + left: -($slider-width + 0.25rem); + } + &::before { + width: $slider-width; + height: 100%; + background-color: #a0a0a0 !important; + border-radius: 100px; + outline: none !important; + } + &::after { + transform: translate($line-height-computed * 0.2, $line-height-computed * 0.2); + width: ceil($circle-width / 1rem * $o-root-font-size); + height: ceil($circle-width / 1rem * $o-root-font-size); + border-radius: 100px; + background-color: $white; + cursor: pointer; } } - - > input:checked + .slider { - background-color: $o-brand-primary; - - &:before { - transform: translate(14px, 0px); + > input.custom-control-input:checked + label.custom-control-label { + &::before { + background-color: $o-brand-primary !important; + } + &::after { + transform: translate($slider-width - $circle-width - $line-height-computed * 0.2, $line-height-computed * 0.2); + background-image: none; } } } |
