diff options
author | Devaev Maxim <[email protected]> | 2020-07-19 16:54:50 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-07-19 16:54:50 +0300 |
commit | 903382fda501e3c5f54d0b82e0067139ab5e11f7 (patch) | |
tree | b132aaedb6c23d362e1a9ea7e9aece8b6dcb1a97 /web/share/css/switch.css | |
parent | af89118eda79ede894ff45a0bea7db030a8d6e86 (diff) |
many style improvements
Diffstat (limited to 'web/share/css/switch.css')
-rw-r--r-- | web/share/css/switch.css | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/web/share/css/switch.css b/web/share/css/switch.css index 425d7578..48889bea 100644 --- a/web/share/css/switch.css +++ b/web/share/css/switch.css @@ -29,11 +29,11 @@ div.switch-box { -moz-user-select: none; } -div.switch-box input[type=checkbox].switch-checkbox { +div.switch-box input[type=checkbox] { display: none; } -div.switch-box label.switch-label { +div.switch-box label { display: block; overflow: hidden; cursor: pointer; @@ -41,14 +41,14 @@ div.switch-box label.switch-label { border-radius: 15px; } -div.switch-box label.switch-label span.switch-inner { +div.switch-box label span.switch-inner { display: block; width: 200%; margin-left: -100%; } -div.switch-box label.switch-label span.switch-inner:before, -div.switch-box label.switch-label span.switch-inner:after { +div.switch-box label span.switch-inner:before, +div.switch-box label span.switch-inner:after { display: block; float: left; width: 50%; @@ -61,15 +61,14 @@ div.switch-box label.switch-label span.switch-inner:after { box-sizing: border-box; } -div.switch-box label.switch-label span.switch-inner:before { +div.switch-box label span.switch-inner:before { content: "ON"; padding-left: 5px; background-color: var(--cs-control-default-bg); color: var(--cs-control-default-fg); text-align: left; } - -div.switch-box label.switch-label span.switch-inner:after { +div.switch-box label span.switch-inner:after { content: "OFF"; padding-right: 5px; background-color: var(--cs-control-default-bg); @@ -77,7 +76,17 @@ div.switch-box label.switch-label span.switch-inner:after { text-align: right; } -div.switch-box label.switch-label span.switch { +@media (hover: hover), (min--moz-device-pixel-ratio: 0) { + /* If we have a mouse cursor */ + div.switch-box label span.switch-inner:not(:disabled):hover::before { + background-color: var(--cs-control-hovered-bg); + } + div.switch-box label span.switch-inner:not(:disabled):hover::after { + background-color: var(--cs-control-hovered-bg); + } +} + +div.switch-box label span.switch { display: block; width: 15px; margin: 0px; @@ -89,15 +98,15 @@ div.switch-box label.switch-label span.switch { border-radius: 15px; } -div.switch-box input[type=checkbox].switch-checkbox:checked + label.switch-label span.switch-inner { +div.switch-box input[type=checkbox]:checked + label span.switch-inner { margin-left: 0; } -div.switch-box input[type=checkbox].switch-checkbox:checked + label.switch-label span.switch { +div.switch-box input[type=checkbox]:checked + label span.switch { right: 0px; } -div.switch-box input[type=checkbox].switch-checkbox:disabled + label.switch-label span.switch { +div.switch-box input[type=checkbox]:disabled + label span.switch { background: var(--cs-thumb-disabled-bg); border: var(--border-default-2px); } |