_switch.scss 1.4 KB

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