style.module.scss
50 lines
| 1 | @use '../../../../../assets/src/css/Safe-Rem/functions' as *; |
| 2 | |
| 3 | .container { |
| 4 | position: relative; |
| 5 | display: flex; |
| 6 | align-items: center; |
| 7 | height: safe-rem(2.15); |
| 8 | margin-right: auto; |
| 9 | font-size: safe-rem(0.9); |
| 10 | |
| 11 | input[type='checkbox']='checkbox'] { |
| 12 | visibility: hidden; |
| 13 | } |
| 14 | |
| 15 | & .switch { |
| 16 | position: absolute; |
| 17 | height: safe-rem(1.715); |
| 18 | width: safe-rem(3.5); |
| 19 | border-radius: 100px; |
| 20 | background: #808080; |
| 21 | transition: 0.35s; |
| 22 | } |
| 23 | |
| 24 | & .switch:before { |
| 25 | position: absolute; |
| 26 | content: ''; |
| 27 | top: 3px; |
| 28 | left: 3px; |
| 29 | height: safe-rem(1.328); |
| 30 | width: safe-rem(1.328); |
| 31 | border-radius: 100px; |
| 32 | background: #ffffff; |
| 33 | box-shadow: 0 0.031rem 0 rgba(0, 0, 0, 0.25); |
| 34 | transition: 0.35s; |
| 35 | } |
| 36 | |
| 37 | & > span:last-child { |
| 38 | transform: translateX(47px); |
| 39 | } |
| 40 | |
| 41 | input[type='checkbox']='checkbox']:checked + .switch { |
| 42 | background: #f49420; |
| 43 | } |
| 44 | |
| 45 | input[type='checkbox']='checkbox']:checked + .switch:before { |
| 46 | left: calc(100% - 3px); |
| 47 | transform: translateX(-100%); |
| 48 | } |
| 49 | } |
| 50 |