bootstrapSwitch.css 13 KB

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