bootstrap-switch.css 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. /* ============================================================
  2. * bootstrapSwitch v1.5 by Larentis Mattia @SpiritualGuru
  3. * http://www.larentis.eu/
  4. *
  5. * Enhanced for radiobuttons by Stein, Peter @BdMdesigN
  6. * http://www.bdmdesign.org/
  7. *
  8. * Project site:
  9. * http://www.larentis.eu/switch/
  10. * ============================================================
  11. * Licensed under the Apache License, Version 2.0
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. * ============================================================ */
  14. .has-switch {
  15. display: inline-block;
  16. cursor: pointer;
  17. -webkit-border-radius: 5px;
  18. -moz-border-radius: 5px;
  19. border-radius: 5px;
  20. border: 1px solid;
  21. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  22. position: relative;
  23. text-align: left;
  24. overflow: hidden;
  25. line-height: 8px;
  26. -webkit-user-select: none;
  27. -moz-user-select: none;
  28. -ms-user-select: none;
  29. -o-user-select: none;
  30. user-select: none;
  31. min-width: 100px;
  32. }
  33. .has-switch.switch-mini {
  34. min-width: 72px;
  35. }
  36. .has-switch.switch-small {
  37. min-width: 80px;
  38. }
  39. .has-switch.switch-large {
  40. min-width: 120px;
  41. }
  42. .has-switch.deactivate {
  43. opacity: 0.5;
  44. filter: alpha(opacity=50);
  45. cursor: default !important;
  46. }
  47. .has-switch.deactivate label,
  48. .has-switch.deactivate span {
  49. cursor: default !important;
  50. }
  51. .has-switch.radio-no-uncheck {
  52. filter: alpha(opacity=50);
  53. cursor: default !important;
  54. }
  55. .has-switch.radio-no-uncheck label,
  56. .has-switch.radio-no-uncheck span {
  57. cursor: default !important;
  58. }
  59. .has-switch > div {
  60. display: inline-block;
  61. width: 150%;
  62. position: relative;
  63. top: 0;
  64. }
  65. .has-switch > div.switch-animate {
  66. -webkit-transition: left 0.5s;
  67. -moz-transition: left 0.5s;
  68. -o-transition: left 0.5s;
  69. transition: left 0.5s;
  70. }
  71. .has-switch > div.switch-off {
  72. left: -50%;
  73. }
  74. .has-switch > div.switch-on {
  75. left: 0%;
  76. }
  77. .has-switch input[type=radio],
  78. .has-switch input[type=checkbox] {
  79. display: none;
  80. }
  81. .has-switch span,
  82. .has-switch label {
  83. -webkit-box-sizing: border-box;
  84. -moz-box-sizing: border-box;
  85. box-sizing: border-box;
  86. cursor: pointer;
  87. position: relative;
  88. display: inline-block;
  89. height: 100%;
  90. padding-bottom: 4px;
  91. padding-top: 4px;
  92. font-size: 14px;
  93. line-height: 20px;
  94. }
  95. .has-switch span.switch-mini,
  96. .has-switch label.switch-mini {
  97. padding-bottom: 4px;
  98. padding-top: 4px;
  99. font-size: 10px;
  100. line-height: 9px;
  101. }
  102. .has-switch span.switch-small,
  103. .has-switch label.switch-small {
  104. padding-bottom: 3px;
  105. padding-top: 3px;
  106. font-size: 12px;
  107. line-height: 18px;
  108. }
  109. .has-switch span.switch-large,
  110. .has-switch label.switch-large {
  111. padding-bottom: 9px;
  112. padding-top: 9px;
  113. font-size: 16px;
  114. line-height: normal;
  115. }
  116. .has-switch label {
  117. text-align: center;
  118. margin-top: -1px;
  119. margin-bottom: -1px;
  120. z-index: 100;
  121. width: 34%;
  122. border-left: 1px solid #cccccc;
  123. border-right: 1px solid #cccccc;
  124. color: #ffffff;
  125. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  126. background-color: #f5f5f5;
  127. background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
  128. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
  129. background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
  130. background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
  131. background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
  132. background-repeat: repeat-x;
  133. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
  134. border-color: #e6e6e6 #e6e6e6 #bfbfbf;
  135. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  136. *background-color: #e6e6e6;
  137. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  138. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  139. }
  140. .has-switch label:hover,
  141. .has-switch label:focus,
  142. .has-switch label:active,
  143. .has-switch label.active,
  144. .has-switch label.disabled,
  145. .has-switch label[disabled] {
  146. color: #ffffff;
  147. background-color: #e6e6e6;
  148. *background-color: #d9d9d9;
  149. }
  150. .has-switch label:active,
  151. .has-switch label.active {
  152. background-color: #cccccc \9;
  153. }
  154. .has-switch label i {
  155. color: #000;
  156. text-shadow: 0 1px 0 #fff;
  157. line-height: 18px;
  158. pointer-events: none;
  159. }
  160. .has-switch span {
  161. text-align: center;
  162. z-index: 1;
  163. width: 33%;
  164. }
  165. .has-switch span.switch-left {
  166. -webkit-border-top-left-radius: 4px;
  167. -moz-border-radius-topleft: 4px;
  168. border-top-left-radius: 4px;
  169. -webkit-border-bottom-left-radius: 4px;
  170. -moz-border-radius-bottomleft: 4px;
  171. border-bottom-left-radius: 4px;
  172. }
  173. .has-switch span.switch-right {
  174. color: #333333;
  175. text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
  176. background-color: #f0f0f0;
  177. background-image: -moz-linear-gradient(top, #e6e6e6, #ffffff);
  178. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff));
  179. background-image: -webkit-linear-gradient(top, #e6e6e6, #ffffff);
  180. background-image: -o-linear-gradient(top, #e6e6e6, #ffffff);
  181. background-image: linear-gradient(to bottom, #e6e6e6, #ffffff);
  182. background-repeat: repeat-x;
  183. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0);
  184. border-color: #ffffff #ffffff #d9d9d9;
  185. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  186. *background-color: #ffffff;
  187. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  188. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  189. }
  190. .has-switch span.switch-right:hover,
  191. .has-switch span.switch-right:focus,
  192. .has-switch span.switch-right:active,
  193. .has-switch span.switch-right.active,
  194. .has-switch span.switch-right.disabled,
  195. .has-switch span.switch-right[disabled] {
  196. color: #333333;
  197. background-color: #ffffff;
  198. *background-color: #f2f2f2;
  199. }
  200. .has-switch span.switch-right:active,
  201. .has-switch span.switch-right.active {
  202. background-color: #e6e6e6 \9;
  203. }
  204. .has-switch span.switch-primary,
  205. .has-switch span.switch-left {
  206. color: #ffffff;
  207. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  208. background-color: #005fcc;
  209. background-image: -moz-linear-gradient(top, #0044cc, #0088cc);
  210. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0044cc), to(#0088cc));
  211. background-image: -webkit-linear-gradient(top, #0044cc, #0088cc);
  212. background-image: -o-linear-gradient(top, #0044cc, #0088cc);
  213. background-image: linear-gradient(to bottom, #0044cc, #0088cc);
  214. background-repeat: repeat-x;
  215. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0044cc', endColorstr='#ff0088cc', GradientType=0);
  216. border-color: #0088cc #0088cc #005580;
  217. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  218. *background-color: #0088cc;
  219. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  220. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  221. }
  222. .has-switch span.switch-primary:hover,
  223. .has-switch span.switch-left:hover,
  224. .has-switch span.switch-primary:focus,
  225. .has-switch span.switch-left:focus,
  226. .has-switch span.switch-primary:active,
  227. .has-switch span.switch-left:active,
  228. .has-switch span.switch-primary.active,
  229. .has-switch span.switch-left.active,
  230. .has-switch span.switch-primary.disabled,
  231. .has-switch span.switch-left.disabled,
  232. .has-switch span.switch-primary[disabled],
  233. .has-switch span.switch-left[disabled] {
  234. color: #ffffff;
  235. background-color: #0088cc;
  236. *background-color: #0077b3;
  237. }
  238. .has-switch span.switch-primary:active,
  239. .has-switch span.switch-left:active,
  240. .has-switch span.switch-primary.active,
  241. .has-switch span.switch-left.active {
  242. background-color: #006699 \9;
  243. }
  244. .has-switch span.switch-info {
  245. color: #ffffff;
  246. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  247. background-color: #41a7c5;
  248. background-image: -moz-linear-gradient(top, #2f96b4, #5bc0de);
  249. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#2f96b4), to(#5bc0de));
  250. background-image: -webkit-linear-gradient(top, #2f96b4, #5bc0de);
  251. background-image: -o-linear-gradient(top, #2f96b4, #5bc0de);
  252. background-image: linear-gradient(to bottom, #2f96b4, #5bc0de);
  253. background-repeat: repeat-x;
  254. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff2f96b4', endColorstr='#ff5bc0de', GradientType=0);
  255. border-color: #5bc0de #5bc0de #28a1c5;
  256. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  257. *background-color: #5bc0de;
  258. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  259. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  260. }
  261. .has-switch span.switch-info:hover,
  262. .has-switch span.switch-info:focus,
  263. .has-switch span.switch-info:active,
  264. .has-switch span.switch-info.active,
  265. .has-switch span.switch-info.disabled,
  266. .has-switch span.switch-info[disabled] {
  267. color: #ffffff;
  268. background-color: #5bc0de;
  269. *background-color: #46b8da;
  270. }
  271. .has-switch span.switch-info:active,
  272. .has-switch span.switch-info.active {
  273. background-color: #31b0d5 \9;
  274. }
  275. .has-switch span.switch-success {
  276. color: #ffffff;
  277. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  278. background-color: #58b058;
  279. background-image: -moz-linear-gradient(top, #51a351, #62c462);
  280. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#51a351), to(#62c462));
  281. background-image: -webkit-linear-gradient(top, #51a351, #62c462);
  282. background-image: -o-linear-gradient(top, #51a351, #62c462);
  283. background-image: linear-gradient(to bottom, #51a351, #62c462);
  284. background-repeat: repeat-x;
  285. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff51a351', endColorstr='#ff62c462', GradientType=0);
  286. border-color: #62c462 #62c462 #3b9e3b;
  287. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  288. *background-color: #62c462;
  289. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  290. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  291. }
  292. .has-switch span.switch-success:hover,
  293. .has-switch span.switch-success:focus,
  294. .has-switch span.switch-success:active,
  295. .has-switch span.switch-success.active,
  296. .has-switch span.switch-success.disabled,
  297. .has-switch span.switch-success[disabled] {
  298. color: #ffffff;
  299. background-color: #62c462;
  300. *background-color: #4fbd4f;
  301. }
  302. .has-switch span.switch-success:active,
  303. .has-switch span.switch-success.active {
  304. background-color: #42b142 \9;
  305. }
  306. .has-switch span.switch-warning {
  307. color: #ffffff;
  308. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  309. background-color: #f9a123;
  310. background-image: -moz-linear-gradient(top, #f89406, #fbb450);
  311. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f89406), to(#fbb450));
  312. background-image: -webkit-linear-gradient(top, #f89406, #fbb450);
  313. background-image: -o-linear-gradient(top, #f89406, #fbb450);
  314. background-image: linear-gradient(to bottom, #f89406, #fbb450);
  315. background-repeat: repeat-x;
  316. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff89406', endColorstr='#fffbb450', GradientType=0);
  317. border-color: #fbb450 #fbb450 #f89406;
  318. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  319. *background-color: #fbb450;
  320. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  321. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  322. }
  323. .has-switch span.switch-warning:hover,
  324. .has-switch span.switch-warning:focus,
  325. .has-switch span.switch-warning:active,
  326. .has-switch span.switch-warning.active,
  327. .has-switch span.switch-warning.disabled,
  328. .has-switch span.switch-warning[disabled] {
  329. color: #ffffff;
  330. background-color: #fbb450;
  331. *background-color: #faa937;
  332. }
  333. .has-switch span.switch-warning:active,
  334. .has-switch span.switch-warning.active {
  335. background-color: #fa9f1e \9;
  336. }
  337. .has-switch span.switch-danger {
  338. color: #ffffff;
  339. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  340. background-color: #d14641;
  341. background-image: -moz-linear-gradient(top, #bd362f, #ee5f5b);
  342. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#bd362f), to(#ee5f5b));
  343. background-image: -webkit-linear-gradient(top, #bd362f, #ee5f5b);
  344. background-image: -o-linear-gradient(top, #bd362f, #ee5f5b);
  345. background-image: linear-gradient(to bottom, #bd362f, #ee5f5b);
  346. background-repeat: repeat-x;
  347. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbd362f', endColorstr='#ffee5f5b', GradientType=0);
  348. border-color: #ee5f5b #ee5f5b #e51d18;
  349. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  350. *background-color: #ee5f5b;
  351. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  352. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  353. }
  354. .has-switch span.switch-danger:hover,
  355. .has-switch span.switch-danger:focus,
  356. .has-switch span.switch-danger:active,
  357. .has-switch span.switch-danger.active,
  358. .has-switch span.switch-danger.disabled,
  359. .has-switch span.switch-danger[disabled] {
  360. color: #ffffff;
  361. background-color: #ee5f5b;
  362. *background-color: #ec4844;
  363. }
  364. .has-switch span.switch-danger:active,
  365. .has-switch span.switch-danger.active {
  366. background-color: #e9322d \9;
  367. }
  368. .has-switch span.switch-default {
  369. color: #333333;
  370. text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
  371. background-color: #f0f0f0;
  372. background-image: -moz-linear-gradient(top, #e6e6e6, #ffffff);
  373. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff));
  374. background-image: -webkit-linear-gradient(top, #e6e6e6, #ffffff);
  375. background-image: -o-linear-gradient(top, #e6e6e6, #ffffff);
  376. background-image: linear-gradient(to bottom, #e6e6e6, #ffffff);
  377. background-repeat: repeat-x;
  378. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0);
  379. border-color: #ffffff #ffffff #d9d9d9;
  380. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  381. *background-color: #ffffff;
  382. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  383. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  384. }
  385. .has-switch span.switch-default:hover,
  386. .has-switch span.switch-default:focus,
  387. .has-switch span.switch-default:active,
  388. .has-switch span.switch-default.active,
  389. .has-switch span.switch-default.disabled,
  390. .has-switch span.switch-default[disabled] {
  391. color: #333333;
  392. background-color: #ffffff;
  393. *background-color: #f2f2f2;
  394. }
  395. .has-switch span.switch-default:active,
  396. .has-switch span.switch-default.active {
  397. background-color: #e6e6e6 \9;
  398. }