bootstrap-switch.css 14 KB

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