bootstrap-switch.css 12 KB

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