_switch.scss 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* The switch - the box around the slider */
  2. .switch {
  3. cursor: pointer;
  4. @include flexbox();
  5. @include align-items(center);
  6. @include justify-content(center);
  7. &__rel {
  8. position: relative;
  9. height: auto;
  10. padding: 0 6px;
  11. @include themify($themes) {
  12. color: themed('landing-button-default');
  13. @include on-event {
  14. color: themed('body-color');
  15. background-color: themed('dropdown-hover-background-color');
  16. }
  17. }
  18. }
  19. &__abs {
  20. position: absolute;
  21. left: -75px;
  22. top: -16px;
  23. z-index: z('menu');
  24. width: 50px;
  25. height: 50px;
  26. margin: auto 0;
  27. @include themify($themes) {
  28. color: themed('landing-button-default');
  29. @include on-event {
  30. color: themed('body-color');
  31. }
  32. }
  33. }
  34. }
  35. /* Hide default HTML checkbox */
  36. .switch input {
  37. opacity: 0;
  38. width: 0;
  39. height: 0;
  40. }
  41. /* The slider */
  42. .slider {
  43. background-color: transparent;
  44. -webkit-transition: .2s;
  45. transition: .2s;
  46. &__icon {
  47. svg {
  48. @include flexbox();
  49. @include align-items(center);
  50. }
  51. }
  52. }
  53. input:checked + .slider:before {
  54. -webkit-transform: translateX(13px);
  55. -ms-transform: translateX(13px);
  56. transform: translateX(13px);
  57. }