bootstrap-switch.css 14 KB

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