bootstrap-switch.css 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /**
  2. * bootstrap-switch - Turn checkboxes and radio buttons into toggle switches.
  3. *
  4. * @version v3.4 for Bootstrap 4.x
  5. * @homepage https://bttstrp.github.io/bootstrap-switch
  6. * @author Mattia Larentis <[email protected]> (http://larentis.eu)
  7. * & djibe
  8. * @license Apache-2.0
  9. */
  10. .bootstrap-switch {
  11. display: inline-block;
  12. direction: ltr;
  13. cursor: pointer;
  14. border-radius: 4px;
  15. border: 1px solid #ccc;
  16. position: relative;
  17. text-align: left;
  18. overflow: hidden;
  19. line-height: 8px;
  20. z-index: 0;
  21. -webkit-user-select: none;
  22. -moz-user-select: none;
  23. -ms-user-select: none;
  24. user-select: none;
  25. vertical-align: middle;
  26. -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
  27. transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
  28. transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
  29. transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
  30. }
  31. .bootstrap-switch .bootstrap-switch-container {
  32. display: inline-block;
  33. top: 0;
  34. border-radius: 4px;
  35. -webkit-transform: translate3d(0, 0, 0);
  36. transform: translate3d(0, 0, 0);
  37. }
  38. .bootstrap-switch .bootstrap-switch-handle-on,
  39. .bootstrap-switch .bootstrap-switch-handle-off,
  40. .bootstrap-switch .bootstrap-switch-label {
  41. -webkit-box-sizing: border-box;
  42. box-sizing: border-box;
  43. cursor: pointer;
  44. display: table-cell;
  45. vertical-align: middle;
  46. padding: 6px 12px;
  47. font-size: 14px;
  48. line-height: 20px;
  49. font-weight: 500;
  50. }
  51. .bootstrap-switch .bootstrap-switch-handle-on,
  52. .bootstrap-switch .bootstrap-switch-handle-off {
  53. text-align: center;
  54. z-index: 1;
  55. }
  56. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
  57. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
  58. background: #007bff;
  59. color: #fff;
  60. }
  61. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,
  62. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
  63. background: #eee;
  64. color: rgba(0, 0, 0, 0.87);
  65. }
  66. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary,
  67. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary {
  68. background: #6c757d;
  69. color: #fff;
  70. }
  71. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,
  72. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info {
  73. background: #17a2b8;
  74. color: #fff;
  75. }
  76. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,
  77. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success {
  78. background: #28a745;
  79. color: #fff;
  80. }
  81. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,
  82. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning {
  83. background: #ffc107;
  84. color: #fff;
  85. }
  86. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,
  87. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger {
  88. background: #dc3545;
  89. color: #fff;
  90. }
  91. .bootstrap-switch .bootstrap-switch-label {
  92. text-align: center;
  93. margin-top: -1px;
  94. margin-bottom: -1px;
  95. z-index: 100;
  96. color: #333;
  97. background: #fff;
  98. padding: 8px 12px;
  99. }
  100. .bootstrap-switch span::before {
  101. content: "\200b";
  102. }
  103. .bootstrap-switch .bootstrap-switch-handle-on {
  104. border-bottom-left-radius: 3px;
  105. border-top-left-radius: 3px;
  106. }
  107. .bootstrap-switch .bootstrap-switch-handle-off {
  108. border-bottom-right-radius: 3px;
  109. border-top-right-radius: 3px;
  110. }
  111. .bootstrap-switch input[type='radio'],
  112. .bootstrap-switch input[type='checkbox'] {
  113. position: absolute !important;
  114. top: 0;
  115. left: 0;
  116. margin: 0;
  117. z-index: -1;
  118. opacity: 0;
  119. filter: alpha(opacity=0);
  120. visibility: hidden;
  121. }
  122. .bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,
  123. .bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,
  124. .bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label {
  125. padding: 1px 5px;
  126. font-size: 12px;
  127. line-height: 1.5;
  128. }
  129. .bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,
  130. .bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,
  131. .bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label {
  132. padding: 5px 10px;
  133. font-size: 12px;
  134. line-height: 1.5;
  135. }
  136. .bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,
  137. .bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,
  138. .bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label {
  139. padding: 6px 16px;
  140. font-size: 18px;
  141. line-height: 1.3333333;
  142. }
  143. .bootstrap-switch.bootstrap-switch-disabled, .bootstrap-switch.bootstrap-switch-readonly, .bootstrap-switch.bootstrap-switch-indeterminate {
  144. cursor: default !important;
  145. }
  146. .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on, .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on, .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on, .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off, .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off, .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off, .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label {
  147. opacity: 0.5;
  148. filter: alpha(opacity=50);
  149. cursor: default !important;
  150. }
  151. .bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
  152. -webkit-transition: margin-left 0.5s;
  153. transition: margin-left 0.5s;
  154. }
  155. .bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on {
  156. border-radius: 0 3px 3px 0;
  157. }
  158. .bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off {
  159. border-radius: 3px 0 0 3px;
  160. }
  161. .bootstrap-switch.bootstrap-switch-focused {
  162. border-color: #66afe9;
  163. outline: 0;
  164. -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
  165. box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
  166. }
  167. .bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label {
  168. border-bottom-right-radius: 3px;
  169. border-top-right-radius: 3px;
  170. }
  171. .bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label {
  172. border-bottom-left-radius: 3px;
  173. border-top-left-radius: 3px;
  174. }