bootstrapSwitch.css 13 KB

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