You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

187 lines
6.2 KiB

7 years ago
  1. /**
  2. * bootstrap-switch - Turn checkboxes and radio buttons into toggle switches.
  3. *
  4. * @version v3.3.4
  5. * @homepage https://bttstrp.github.io/bootstrap-switch
  6. * @author Mattia Larentis <mattia@larentis.eu> (http://larentis.eu)
  7. * @license Apache-2.0
  8. */
  9. .bootstrap-switch {
  10. display: inline-block;
  11. direction: ltr;
  12. cursor: pointer;
  13. border-radius: 4px;
  14. border: 1px solid;
  15. border-color: #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, box-shadow ease-in-out .15s;
  27. -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
  28. transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
  29. }
  30. .bootstrap-switch .bootstrap-switch-container {
  31. display: inline-block;
  32. top: 0;
  33. border-radius: 4px;
  34. -webkit-transform: translate3d(0, 0, 0);
  35. transform: translate3d(0, 0, 0);
  36. }
  37. .bootstrap-switch .bootstrap-switch-handle-on,
  38. .bootstrap-switch .bootstrap-switch-handle-off,
  39. .bootstrap-switch .bootstrap-switch-label {
  40. -webkit-box-sizing: border-box;
  41. -moz-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. }
  50. .bootstrap-switch .bootstrap-switch-handle-on,
  51. .bootstrap-switch .bootstrap-switch-handle-off {
  52. text-align: center;
  53. z-index: 1;
  54. }
  55. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
  56. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
  57. color: #fff;
  58. background: #337ab7;
  59. }
  60. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,
  61. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info {
  62. color: #fff;
  63. background: #5bc0de;
  64. }
  65. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,
  66. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success {
  67. color: #fff;
  68. background: #5cb85c;
  69. }
  70. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,
  71. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning {
  72. background: #f0ad4e;
  73. color: #fff;
  74. }
  75. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,
  76. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger {
  77. color: #fff;
  78. background: #d9534f;
  79. }
  80. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,
  81. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
  82. color: #000;
  83. background: #eeeeee;
  84. }
  85. .bootstrap-switch .bootstrap-switch-label {
  86. text-align: center;
  87. margin-top: -1px;
  88. margin-bottom: -1px;
  89. z-index: 100;
  90. color: #333;
  91. background: #fff;
  92. }
  93. .bootstrap-switch span::before {
  94. content: "\200b";
  95. }
  96. .bootstrap-switch .bootstrap-switch-handle-on {
  97. border-bottom-left-radius: 3px;
  98. border-top-left-radius: 3px;
  99. }
  100. .bootstrap-switch .bootstrap-switch-handle-off {
  101. border-bottom-right-radius: 3px;
  102. border-top-right-radius: 3px;
  103. }
  104. .bootstrap-switch input[type='radio'],
  105. .bootstrap-switch input[type='checkbox'] {
  106. position: absolute !important;
  107. top: 0;
  108. left: 0;
  109. margin: 0;
  110. z-index: -1;
  111. opacity: 0;
  112. filter: alpha(opacity=0);
  113. visibility: hidden;
  114. }
  115. .bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,
  116. .bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,
  117. .bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label {
  118. padding: 1px 5px;
  119. font-size: 12px;
  120. line-height: 1.5;
  121. }
  122. .bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,
  123. .bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,
  124. .bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label {
  125. padding: 5px 10px;
  126. font-size: 12px;
  127. line-height: 1.5;
  128. }
  129. .bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,
  130. .bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,
  131. .bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label {
  132. padding: 6px 16px;
  133. font-size: 18px;
  134. line-height: 1.3333333;
  135. }
  136. .bootstrap-switch.bootstrap-switch-disabled,
  137. .bootstrap-switch.bootstrap-switch-readonly,
  138. .bootstrap-switch.bootstrap-switch-indeterminate {
  139. cursor: default !important;
  140. }
  141. .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,
  142. .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,
  143. .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,
  144. .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,
  145. .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,
  146. .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,
  147. .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,
  148. .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label,
  149. .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label {
  150. opacity: 0.5;
  151. filter: alpha(opacity=50);
  152. cursor: default !important;
  153. }
  154. .bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
  155. -webkit-transition: margin-left 0.5s;
  156. -o-transition: margin-left 0.5s;
  157. transition: margin-left 0.5s;
  158. }
  159. .bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on {
  160. border-bottom-left-radius: 0;
  161. border-top-left-radius: 0;
  162. border-bottom-right-radius: 3px;
  163. border-top-right-radius: 3px;
  164. }
  165. .bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off {
  166. border-bottom-right-radius: 0;
  167. border-top-right-radius: 0;
  168. border-bottom-left-radius: 3px;
  169. border-top-left-radius: 3px;
  170. }
  171. .bootstrap-switch.bootstrap-switch-focused {
  172. border-color: #66afe9;
  173. outline: 0;
  174. -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
  175. box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
  176. }
  177. .bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label,
  178. .bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label {
  179. border-bottom-right-radius: 3px;
  180. border-top-right-radius: 3px;
  181. }
  182. .bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label,
  183. .bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label {
  184. border-bottom-left-radius: 3px;
  185. border-top-left-radius: 3px;
  186. }