bootstrap-switch.css 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. /**
  2. * bootstrap-switch - Turn checkboxes and radio buttons into toggle switches.
  3. *
  4. * @version v4.0.0-alpha.1
  5. * @homepage http://www.bootstrap-switch.org
  6. * @author Mattia Larentis <[email protected]> (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: 0.25rem;
  14. border: 1px solid;
  15. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  16. position: relative;
  17. text-align: left;
  18. overflow: hidden;
  19. line-height: 8px;
  20. z-index: 0;
  21. user-select: none;
  22. vertical-align: middle;
  23. transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; }
  24. .bootstrap-switch .bootstrap-switch-container {
  25. display: inline-block;
  26. top: 0;
  27. border-radius: 0.25rem;
  28. transform: translate3d(0, 0, 0); }
  29. .bootstrap-switch .bootstrap-switch-handle-on,
  30. .bootstrap-switch .bootstrap-switch-handle-off,
  31. .bootstrap-switch .bootstrap-switch-label {
  32. box-sizing: border-box;
  33. cursor: pointer;
  34. display: inline-block !important;
  35. height: 100%;
  36. line-height: 1.25;
  37. padding: 0.5rem 1rem;
  38. font-size: 1rem;
  39. border-radius: 0; }
  40. .bootstrap-switch .bootstrap-switch-handle-on,
  41. .bootstrap-switch .bootstrap-switch-handle-off {
  42. text-align: center;
  43. z-index: 1; }
  44. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
  45. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
  46. color: #fff;
  47. background-color: #0275d8;
  48. border-color: #0275d8; }
  49. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary:hover,
  50. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary:hover {
  51. color: #fff;
  52. background-color: #025aa5;
  53. border-color: #01549b; }
  54. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary:focus, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary.focus,
  55. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary:focus,
  56. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary.focus {
  57. box-shadow: 0 0 0 2px rgba(2, 117, 216, 0.5); }
  58. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary.disabled, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary:disabled,
  59. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary.disabled,
  60. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary:disabled {
  61. background-color: #0275d8;
  62. border-color: #0275d8; }
  63. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary:active, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary.active,
  64. .show > .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary.dropdown-toggle,
  65. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary:active,
  66. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary.active,
  67. .show >
  68. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary.dropdown-toggle {
  69. color: #fff;
  70. background-color: #025aa5;
  71. background-image: none;
  72. border-color: #01549b; }
  73. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary,
  74. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary {
  75. color: #292b2c;
  76. background-color: #fff;
  77. border-color: #ccc; }
  78. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary:hover,
  79. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary:hover {
  80. color: #292b2c;
  81. background-color: #e6e6e6;
  82. border-color: #adadad; }
  83. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary:focus, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary.focus,
  84. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary:focus,
  85. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary.focus {
  86. box-shadow: 0 0 0 2px rgba(204, 204, 204, 0.5); }
  87. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary.disabled, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary:disabled,
  88. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary.disabled,
  89. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary:disabled {
  90. background-color: #fff;
  91. border-color: #ccc; }
  92. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary:active, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary.active,
  93. .show > .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-secondary.dropdown-toggle,
  94. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary:active,
  95. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary.active,
  96. .show >
  97. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-secondary.dropdown-toggle {
  98. color: #292b2c;
  99. background-color: #e6e6e6;
  100. background-image: none;
  101. border-color: #adadad; }
  102. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,
  103. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info {
  104. color: #fff;
  105. background-color: #5bc0de;
  106. border-color: #5bc0de; }
  107. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info:hover,
  108. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info:hover {
  109. color: #fff;
  110. background-color: #31b0d5;
  111. border-color: #2aabd2; }
  112. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info:focus, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info.focus,
  113. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info:focus,
  114. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info.focus {
  115. box-shadow: 0 0 0 2px rgba(91, 192, 222, 0.5); }
  116. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info.disabled, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info:disabled,
  117. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info.disabled,
  118. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info:disabled {
  119. background-color: #5bc0de;
  120. border-color: #5bc0de; }
  121. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info:active, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info.active,
  122. .show > .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info.dropdown-toggle,
  123. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info:active,
  124. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info.active,
  125. .show >
  126. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info.dropdown-toggle {
  127. color: #fff;
  128. background-color: #31b0d5;
  129. background-image: none;
  130. border-color: #2aabd2; }
  131. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,
  132. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success {
  133. color: #fff;
  134. background-color: #5cb85c;
  135. border-color: #5cb85c; }
  136. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success:hover,
  137. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success:hover {
  138. color: #fff;
  139. background-color: #449d44;
  140. border-color: #419641; }
  141. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success:focus, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success.focus,
  142. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success:focus,
  143. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success.focus {
  144. box-shadow: 0 0 0 2px rgba(92, 184, 92, 0.5); }
  145. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success.disabled, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success:disabled,
  146. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success.disabled,
  147. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success:disabled {
  148. background-color: #5cb85c;
  149. border-color: #5cb85c; }
  150. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success:active, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success.active,
  151. .show > .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success.dropdown-toggle,
  152. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success:active,
  153. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success.active,
  154. .show >
  155. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success.dropdown-toggle {
  156. color: #fff;
  157. background-color: #449d44;
  158. background-image: none;
  159. border-color: #419641; }
  160. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,
  161. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning {
  162. color: #fff;
  163. background-color: #f0ad4e;
  164. border-color: #f0ad4e; }
  165. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning:hover,
  166. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning:hover {
  167. color: #fff;
  168. background-color: #ec971f;
  169. border-color: #eb9316; }
  170. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning:focus, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning.focus,
  171. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning:focus,
  172. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning.focus {
  173. box-shadow: 0 0 0 2px rgba(240, 173, 78, 0.5); }
  174. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning.disabled, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning:disabled,
  175. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning.disabled,
  176. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning:disabled {
  177. background-color: #f0ad4e;
  178. border-color: #f0ad4e; }
  179. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning:active, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning.active,
  180. .show > .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning.dropdown-toggle,
  181. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning:active,
  182. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning.active,
  183. .show >
  184. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning.dropdown-toggle {
  185. color: #fff;
  186. background-color: #ec971f;
  187. background-image: none;
  188. border-color: #eb9316; }
  189. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,
  190. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger {
  191. color: #fff;
  192. background-color: #d9534f;
  193. border-color: #d9534f; }
  194. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger:hover,
  195. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger:hover {
  196. color: #fff;
  197. background-color: #c9302c;
  198. border-color: #c12e2a; }
  199. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger:focus, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger.focus,
  200. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger:focus,
  201. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger.focus {
  202. box-shadow: 0 0 0 2px rgba(217, 83, 79, 0.5); }
  203. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger.disabled, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger:disabled,
  204. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger.disabled,
  205. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger:disabled {
  206. background-color: #d9534f;
  207. border-color: #d9534f; }
  208. .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger:active, .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger.active,
  209. .show > .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger.dropdown-toggle,
  210. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger:active,
  211. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger.active,
  212. .show >
  213. .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger.dropdown-toggle {
  214. color: #fff;
  215. background-color: #c9302c;
  216. background-image: none;
  217. border-color: #c12e2a; }
  218. .bootstrap-switch .bootstrap-switch-label {
  219. text-align: center;
  220. margin-top: -1px;
  221. margin-bottom: -1px;
  222. z-index: 100;
  223. border-left: 1px solid transparent;
  224. border-right: 1px solid transparent; }
  225. .bootstrap-switch .bootstrap-switch-handle-on {
  226. border-bottom-left-radius: 0.25rem;
  227. border-top-left-radius: 0.25rem; }
  228. .bootstrap-switch .bootstrap-switch-handle-off {
  229. border-bottom-right-radius: 0.25rem;
  230. border-top-right-radius: 0.25rem; }
  231. .bootstrap-switch input[type='radio'],
  232. .bootstrap-switch input[type='checkbox'] {
  233. position: absolute !important;
  234. top: 0;
  235. left: 0;
  236. opacity: 0;
  237. z-index: -1; }
  238. .bootstrap-switch.bootstrap-switch-mini {
  239. min-width: 71px; }
  240. .bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,
  241. .bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,
  242. .bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label {
  243. padding: 0.25rem 0.5rem;
  244. font-size: 0.875rem;
  245. border-radius: 0.2rem; }
  246. .bootstrap-switch.bootstrap-switch-small {
  247. min-width: 79px; }
  248. .bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,
  249. .bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,
  250. .bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label {
  251. padding: 0.25rem 0.5rem;
  252. font-size: 0.875rem;
  253. border-radius: 0.2rem; }
  254. .bootstrap-switch.bootstrap-switch-large {
  255. min-width: 120px; }
  256. .bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,
  257. .bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,
  258. .bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label {
  259. padding: 0.75rem 1.5rem;
  260. font-size: 1.25rem;
  261. border-radius: 0.3rem; }
  262. .bootstrap-switch.bootstrap-switch-disabled, .bootstrap-switch.bootstrap-switch-readonly, .bootstrap-switch.bootstrap-switch-indeterminate {
  263. cursor: default !important; }
  264. .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,
  265. .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,
  266. .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,
  267. .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,
  268. .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,
  269. .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,
  270. .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label {
  271. opacity: .5;
  272. cursor: default !important; }
  273. .bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
  274. transition: margin-left 0.5s; }
  275. .bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on {
  276. border-bottom-left-radius: 0;
  277. border-top-left-radius: 0;
  278. border-bottom-right-radius: 0.25rem;
  279. border-top-right-radius: 0.25rem; }
  280. .bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off {
  281. border-bottom-right-radius: 0;
  282. border-top-right-radius: 0;
  283. border-bottom-left-radius: 0.25rem;
  284. border-top-left-radius: 0.25rem; }
  285. .bootstrap-switch.bootstrap-switch-focused {
  286. box-shadow: 0 0 0 2px rgba(2, 117, 216, 0.5); }
  287. .bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label {
  288. border-bottom-right-radius: 0.25rem;
  289. border-top-right-radius: 0.25rem; }
  290. .bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label, .bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label {
  291. border-bottom-left-radius: 0.25rem;
  292. border-top-left-radius: 0.25rem; }