_switch.scss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /* ============================================================
  2. SWITCH 3 - YES NO
  3. ============================================================ */
  4. .gf-form-switch {
  5. &--small {
  6. max-width: 2rem;
  7. min-width: 1.5rem;
  8. input + label {
  9. height: 25px;
  10. }
  11. input + label::before,
  12. input + label::after {
  13. font-size: $font-size-sm;
  14. }
  15. }
  16. &--table-cell {
  17. margin-bottom: 0;
  18. margin-right: 0;
  19. input + label {
  20. height: 3.6rem;
  21. }
  22. }
  23. }
  24. .gf-form-switch--transparent {
  25. input + label {
  26. background: transparent;
  27. border: none;
  28. }
  29. input + label::before,
  30. input + label::after {
  31. background: transparent;
  32. border: none;
  33. }
  34. &:hover {
  35. input + label::before {
  36. background: transparent;
  37. }
  38. input + label::after {
  39. background: transparent;
  40. }
  41. }
  42. }
  43. .gf-form-switch--search-result__section {
  44. min-width: 3.05rem;
  45. margin-right: -0.3rem;
  46. input + label {
  47. height: 1.7rem;
  48. }
  49. }
  50. .gf-form-switch--search-result__item {
  51. min-width: 2.7rem;
  52. input + label {
  53. height: 2.7rem;
  54. }
  55. }
  56. .gf-form-switch--search-result-filter-row__checkbox {
  57. min-width: 3.75rem;
  58. input + label {
  59. height: 2.5rem;
  60. }
  61. }
  62. gf-form-switch[disabled] {
  63. .gf-form-label,
  64. .gf-form-switch input + label {
  65. cursor: default;
  66. pointer-events: none !important;
  67. &::before,
  68. &::after {
  69. color: $text-color-faint;
  70. text-shadow: none;
  71. }
  72. }
  73. }
  74. .gf-form-switch {
  75. position: relative;
  76. display: inline-block;
  77. width: 60px;
  78. height: 34px;
  79. border-radius: 34px;
  80. input {
  81. opacity: 0;
  82. width: 0;
  83. height: 0;
  84. }
  85. }
  86. /* The slider */
  87. .gf-form-switch__slider {
  88. position: absolute;
  89. cursor: pointer;
  90. top: 0;
  91. left: 0;
  92. right: 0;
  93. bottom: 0;
  94. background: $dark-3;
  95. transition: 0.4s;
  96. &::before {
  97. position: absolute;
  98. content: '';
  99. height: 26px;
  100. width: 26px;
  101. left: 4px;
  102. bottom: 4px;
  103. background: $dark-4;
  104. transition: 0.4s;
  105. border-radius: 50%;
  106. }
  107. }
  108. input:checked + .gf-form-switch__slider {
  109. background-color: $dark-5;
  110. }
  111. /* input:focus + .gf-form-switch__slider { */
  112. /* box-shadow: 0 0 1px #2196f3; */
  113. /* } */
  114. input:checked + .gf-form-switch__slider:before {
  115. transform: translateX(26px);
  116. background: $blue;
  117. }