onoffswitch.css 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* On/Off FlipSwitch https://proto.io/freebies/onoff/ */
  2. .onoffswitch {
  3. position: relative;
  4. margin: 1ex 0;
  5. -webkit-user-select: none;
  6. -moz-user-select: none;
  7. -ms-user-select: none;
  8. }
  9. .onoffswitch input {
  10. display: none;
  11. }
  12. .onoffswitch span {
  13. display: block;
  14. overflow: hidden;
  15. cursor: pointer;
  16. height: 12px;
  17. padding: 0;
  18. line-height: 12px;
  19. border: 0 solid #E3E3E3;
  20. border-radius: 12px;
  21. background-color: #E0E0E0;
  22. box-shadow: inset 2px 2px 4px rgba(0,0,0,0.1);
  23. }
  24. .onoffswitch span::before {
  25. content: "";
  26. display: block;
  27. width: 18px;
  28. height: 18px;
  29. margin: -3px;
  30. background: #efefef;
  31. position: absolute;
  32. top: 0;
  33. bottom: 0;
  34. right: 46px;
  35. border-radius: 18px;
  36. box-shadow: 0 3px 13px 0 rgba(0, 0, 0, 0.4);
  37. }
  38. .onoffswitch input:checked + span {
  39. background-color: #CAEBE3;
  40. }
  41. .onoffswitch input:checked + span, .onoffswitch input:checked + span::before {
  42. border-color: #CAEBE3;
  43. }
  44. .onoffswitch input:checked + span .onoffswitch-inner {
  45. margin-left: 0;
  46. }
  47. .onoffswitch input:checked + span::before {
  48. right: 0;
  49. background-color: #04BA9F;
  50. box-shadow: 3px 6px 18px 0 rgba(0, 0, 0, 0.2);
  51. }