_switch.scss 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. z-index: z('menu');
  22. width: 50px;
  23. height: 50px;
  24. margin: auto 0;
  25. &[data-dir="rtl"] {
  26. right: -75px;
  27. top: -16px;
  28. }
  29. &[data-dir="ltr"] {
  30. left: -75px;
  31. top: -16px;
  32. }
  33. @include themify($themes) {
  34. color: themed('landing-button-default');
  35. @include on-event {
  36. color: themed('body-color');
  37. }
  38. }
  39. }
  40. }
  41. /* Hide default HTML checkbox */
  42. .switch input {
  43. opacity: 0;
  44. width: 0;
  45. height: 0;
  46. }
  47. /* The slider */
  48. .slider {
  49. background-color: transparent;
  50. -webkit-transition: .2s;
  51. transition: .2s;
  52. &__icon {
  53. svg {
  54. @include flexbox();
  55. @include align-items(center);
  56. }
  57. }
  58. }
  59. input:checked + .slider:before {
  60. -webkit-transform: translateX(13px);
  61. -ms-transform: translateX(13px);
  62. transform: translateX(13px);
  63. }