OLD | NEW |
(Empty) | |
| 1 io-toggle { |
| 2 --width: 30px; |
| 3 --height: 8px; |
| 4 --translateY: -4px; |
| 5 --translateX: 14px; |
| 6 display: inline-block; |
| 7 width: var(--width); |
| 8 height: var(--height); |
| 9 border-radius: 4px; |
| 10 background-color: #9b9b9b; |
| 11 transition: background .2s ease-out; |
| 12 will-change: background; |
| 13 cursor: pointer; |
| 14 } |
| 15 |
| 16 io-toggle[checked] { |
| 17 background-color: #92d3ea; |
| 18 } |
| 19 |
| 20 io-toggle[disabled] { |
| 21 opacity: 0.5; |
| 22 cursor: default; |
| 23 } |
| 24 |
| 25 io-toggle button { |
| 26 width: calc(var(--height) * 2); |
| 27 height: calc(var(--height) * 2); |
| 28 padding: 0; |
| 29 border: 2px solid #e1e0e1; |
| 30 border-radius: var(--height); |
| 31 transition: border .2s ease-out, box-shadow .2s ease-out, |
| 32 transform .2s ease-out, width .2s ease-out; |
| 33 will-change: border, box-shadow, transform, width; |
| 34 transform: translateY(var(--translateY)); |
| 35 outline: none; |
| 36 cursor: pointer; |
| 37 } |
| 38 |
| 39 io-toggle button[aria-checked="false"] |
| 40 { |
| 41 background-color: #f1f1f1; |
| 42 box-shadow: 0 1px 2px 0 #e5d1d1; |
| 43 } |
| 44 |
| 45 io-toggle button[aria-checked="false"]:hover |
| 46 { |
| 47 box-shadow: 0 2px 4px 0 #d3b0b0; |
| 48 } |
| 49 |
| 50 io-toggle button[aria-checked="true"] |
| 51 { |
| 52 background-color: #059cd0; |
| 53 border: 2px solid #059cd0; |
| 54 box-shadow: 0 1px 2px 0 #a6cede; |
| 55 transform: translateY(var(--translateY)) translateX(var(--translateX)); |
| 56 } |
| 57 |
| 58 io-toggle button[aria-checked="true"]:hover |
| 59 { |
| 60 box-shadow: 0 2px 4px 0 #a6cede; |
| 61 } |
| 62 |
| 63 io-toggle button:focus, |
| 64 io-toggle button[aria-checked="true"]:focus |
| 65 { |
| 66 border: 2px solid #87bffe; |
| 67 } |
| 68 |
| 69 /* in case we will need to switch active/disabled direction |
| 70 body[dir="rtl"] io-toggle button[aria-checked="true"] |
| 71 { |
| 72 transform: translateY(var(--translateY)) translateX(calc(var(--translateX) * -
1)); |
| 73 } |
| 74 //*/ |
OLD | NEW |