bootstrap-switch.css 14 KB

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