_switch.scss 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* The switch - the box around the slider */
  2. .switch {
  3. position: absolute;
  4. right: -2rem;
  5. top: 1.75rem;
  6. display: inline-block;
  7. width: 30px;
  8. height: 16px;
  9. z-index: z('gtt');
  10. }
  11. /* Hide default HTML checkbox */
  12. .switch input {
  13. opacity: 0;
  14. width: 0;
  15. height: 0;
  16. }
  17. /* The slider */
  18. .slider {
  19. position: absolute;
  20. cursor: pointer;
  21. top: 0;
  22. left: 0;
  23. right: 0;
  24. bottom: 0;
  25. background-color: transparent;
  26. -webkit-transition: .2s;
  27. transition: .2s;
  28. &:before {
  29. position: absolute;
  30. content: "";
  31. height: 12px;
  32. width: 13px;
  33. left: 2px;
  34. bottom: 2px;
  35. -webkit-transition: .2s;
  36. transition: .2s;
  37. }
  38. &__icon {
  39. padding: 0.5rem;
  40. }
  41. }
  42. // input:checked + .slider {
  43. // @include themify($themes) {
  44. // background-color: transparent;
  45. // }
  46. // }
  47. // input:focus + .slider {
  48. // @include themify($themes) {
  49. // background-color: transparent;
  50. // }
  51. // }
  52. input:checked + .slider:before {
  53. -webkit-transform: translateX(13px);
  54. -ms-transform: translateX(13px);
  55. transform: translateX(13px);
  56. }