bootstrapSwitch.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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: -49%;
  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. 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 span {
  139. text-align: center;
  140. z-index: 1;
  141. width: 33%;
  142. }
  143. .has-switch span.switch-left {
  144. -webkit-border-top-left-radius: 4px;
  145. -moz-border-radius-topleft: 4px;
  146. border-top-left-radius: 4px;
  147. -webkit-border-bottom-left-radius: 4px;
  148. -moz-border-radius-bottomleft: 4px;
  149. border-bottom-left-radius: 4px;
  150. }
  151. .has-switch span.switch-right {
  152. color: #333333;
  153. text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
  154. background-color: #f0f0f0;
  155. background-image: -moz-linear-gradient(top, #e6e6e6, #ffffff);
  156. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff));
  157. background-image: -webkit-linear-gradient(top, #e6e6e6, #ffffff);
  158. background-image: -o-linear-gradient(top, #e6e6e6, #ffffff);
  159. background-image: linear-gradient(to bottom, #e6e6e6, #ffffff);
  160. background-repeat: repeat-x;
  161. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0);
  162. border-color: #ffffff #ffffff #d9d9d9;
  163. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  164. *background-color: #ffffff;
  165. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  166. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  167. }
  168. .has-switch span.switch-right:hover,
  169. .has-switch span.switch-right:focus,
  170. .has-switch span.switch-right:active,
  171. .has-switch span.switch-right.active,
  172. .has-switch span.switch-right.disabled,
  173. .has-switch span.switch-right[disabled] {
  174. color: #333333;
  175. background-color: #ffffff;
  176. *background-color: #f2f2f2;
  177. }
  178. .has-switch span.switch-right:active,
  179. .has-switch span.switch-right.active {
  180. background-color: #e6e6e6 \9;
  181. }
  182. .has-switch span.switch-primary,
  183. .has-switch span.switch-left {
  184. color: #ffffff;
  185. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  186. background-color: #005fcc;
  187. background-image: -moz-linear-gradient(top, #0044cc, #0088cc);
  188. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0044cc), to(#0088cc));
  189. background-image: -webkit-linear-gradient(top, #0044cc, #0088cc);
  190. background-image: -o-linear-gradient(top, #0044cc, #0088cc);
  191. background-image: linear-gradient(to bottom, #0044cc, #0088cc);
  192. background-repeat: repeat-x;
  193. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0044cc', endColorstr='#ff0088cc', GradientType=0);
  194. border-color: #0088cc #0088cc #005580;
  195. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  196. *background-color: #0088cc;
  197. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  198. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  199. }
  200. .has-switch span.switch-primary:hover,
  201. .has-switch span.switch-left:hover,
  202. .has-switch span.switch-primary:focus,
  203. .has-switch span.switch-left:focus,
  204. .has-switch span.switch-primary:active,
  205. .has-switch span.switch-left:active,
  206. .has-switch span.switch-primary.active,
  207. .has-switch span.switch-left.active,
  208. .has-switch span.switch-primary.disabled,
  209. .has-switch span.switch-left.disabled,
  210. .has-switch span.switch-primary[disabled],
  211. .has-switch span.switch-left[disabled] {
  212. color: #ffffff;
  213. background-color: #0088cc;
  214. *background-color: #0077b3;
  215. }
  216. .has-switch span.switch-primary:active,
  217. .has-switch span.switch-left:active,
  218. .has-switch span.switch-primary.active,
  219. .has-switch span.switch-left.active {
  220. background-color: #006699 \9;
  221. }
  222. .has-switch span.switch-info {
  223. color: #ffffff;
  224. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  225. background-color: #41a7c5;
  226. background-image: -moz-linear-gradient(top, #2f96b4, #5bc0de);
  227. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#2f96b4), to(#5bc0de));
  228. background-image: -webkit-linear-gradient(top, #2f96b4, #5bc0de);
  229. background-image: -o-linear-gradient(top, #2f96b4, #5bc0de);
  230. background-image: linear-gradient(to bottom, #2f96b4, #5bc0de);
  231. background-repeat: repeat-x;
  232. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff2f96b4', endColorstr='#ff5bc0de', GradientType=0);
  233. border-color: #5bc0de #5bc0de #28a1c5;
  234. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  235. *background-color: #5bc0de;
  236. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  237. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  238. }
  239. .has-switch span.switch-info:hover,
  240. .has-switch span.switch-info:focus,
  241. .has-switch span.switch-info:active,
  242. .has-switch span.switch-info.active,
  243. .has-switch span.switch-info.disabled,
  244. .has-switch span.switch-info[disabled] {
  245. color: #ffffff;
  246. background-color: #5bc0de;
  247. *background-color: #46b8da;
  248. }
  249. .has-switch span.switch-info:active,
  250. .has-switch span.switch-info.active {
  251. background-color: #31b0d5 \9;
  252. }
  253. .has-switch span.switch-success {
  254. color: #ffffff;
  255. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  256. background-color: #58b058;
  257. background-image: -moz-linear-gradient(top, #51a351, #62c462);
  258. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#51a351), to(#62c462));
  259. background-image: -webkit-linear-gradient(top, #51a351, #62c462);
  260. background-image: -o-linear-gradient(top, #51a351, #62c462);
  261. background-image: linear-gradient(to bottom, #51a351, #62c462);
  262. background-repeat: repeat-x;
  263. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff51a351', endColorstr='#ff62c462', GradientType=0);
  264. border-color: #62c462 #62c462 #3b9e3b;
  265. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  266. *background-color: #62c462;
  267. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  268. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  269. }
  270. .has-switch span.switch-success:hover,
  271. .has-switch span.switch-success:focus,
  272. .has-switch span.switch-success:active,
  273. .has-switch span.switch-success.active,
  274. .has-switch span.switch-success.disabled,
  275. .has-switch span.switch-success[disabled] {
  276. color: #ffffff;
  277. background-color: #62c462;
  278. *background-color: #4fbd4f;
  279. }
  280. .has-switch span.switch-success:active,
  281. .has-switch span.switch-success.active {
  282. background-color: #42b142 \9;
  283. }
  284. .has-switch span.switch-warning {
  285. color: #ffffff;
  286. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  287. background-color: #f9a123;
  288. background-image: -moz-linear-gradient(top, #f89406, #fbb450);
  289. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f89406), to(#fbb450));
  290. background-image: -webkit-linear-gradient(top, #f89406, #fbb450);
  291. background-image: -o-linear-gradient(top, #f89406, #fbb450);
  292. background-image: linear-gradient(to bottom, #f89406, #fbb450);
  293. background-repeat: repeat-x;
  294. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff89406', endColorstr='#fffbb450', GradientType=0);
  295. border-color: #fbb450 #fbb450 #f89406;
  296. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  297. *background-color: #fbb450;
  298. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  299. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  300. }
  301. .has-switch span.switch-warning:hover,
  302. .has-switch span.switch-warning:focus,
  303. .has-switch span.switch-warning:active,
  304. .has-switch span.switch-warning.active,
  305. .has-switch span.switch-warning.disabled,
  306. .has-switch span.switch-warning[disabled] {
  307. color: #ffffff;
  308. background-color: #fbb450;
  309. *background-color: #faa937;
  310. }
  311. .has-switch span.switch-warning:active,
  312. .has-switch span.switch-warning.active {
  313. background-color: #fa9f1e \9;
  314. }
  315. .has-switch span.switch-danger {
  316. color: #ffffff;
  317. text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  318. background-color: #d14641;
  319. background-image: -moz-linear-gradient(top, #bd362f, #ee5f5b);
  320. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#bd362f), to(#ee5f5b));
  321. background-image: -webkit-linear-gradient(top, #bd362f, #ee5f5b);
  322. background-image: -o-linear-gradient(top, #bd362f, #ee5f5b);
  323. background-image: linear-gradient(to bottom, #bd362f, #ee5f5b);
  324. background-repeat: repeat-x;
  325. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbd362f', endColorstr='#ffee5f5b', GradientType=0);
  326. border-color: #ee5f5b #ee5f5b #e51d18;
  327. border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  328. *background-color: #ee5f5b;
  329. /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  330. filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  331. }
  332. .has-switch span.switch-danger:hover,
  333. .has-switch span.switch-danger:focus,
  334. .has-switch span.switch-danger:active,
  335. .has-switch span.switch-danger.active,
  336. .has-switch span.switch-danger.disabled,
  337. .has-switch span.switch-danger[disabled] {
  338. color: #ffffff;
  339. background-color: #ee5f5b;
  340. *background-color: #ec4844;
  341. }
  342. .has-switch span.switch-danger:active,
  343. .has-switch span.switch-danger.active {
  344. background-color: #e9322d \9;
  345. }