bootstrap-switch.css 14 KB

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