bootstrapSwitch.css 12 KB

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