inputswitch.css 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /* ========================================================================
  2. * bootstrap-switch - v3.0.2
  3. * http://www.bootstrap-switch.org
  4. * ========================================================================
  5. * Copyright 2012-2013 Mattia Larentis
  6. *
  7. * ========================================================================
  8. * Licensed under the Apache License, Version 2.0 (the "License");
  9. * you may not use this file except in compliance with the License.
  10. * You may obtain a copy of the License at
  11. *
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. *
  14. * Unless required by applicable law or agreed to in writing, software
  15. * distributed under the License is distributed on an "AS IS" BASIS,
  16. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. * See the License for the specific language governing permissions and
  18. * limitations under the License.
  19. * ========================================================================
  20. */
  21. .bootstrap-switch {
  22. line-height: 8px;
  23. position: relative;
  24. display: inline-block;
  25. overflow: hidden;
  26. min-width: 100px;
  27. cursor: pointer;
  28. -webkit-user-select: none;
  29. -moz-user-select: none;
  30. -ms-user-select: none;
  31. user-select: none;
  32. text-align: left;
  33. vertical-align: middle;
  34. border: 1px solid;
  35. border-color: #ccc;
  36. border-radius: 4px;
  37. }
  38. .bootstrap-switch.bootstrap-switch-mini {
  39. min-width: 71px;
  40. }
  41. .bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,
  42. .bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,
  43. .bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label {
  44. font-size: 10px;
  45. line-height: 9px;
  46. padding-top: 4px;
  47. padding-bottom: 4px;
  48. }
  49. .bootstrap-switch.bootstrap-switch-small {
  50. min-width: 79px;
  51. }
  52. .bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,
  53. .bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,
  54. .bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label {
  55. font-size: 12px;
  56. line-height: 18px;
  57. padding-top: 3px;
  58. padding-bottom: 3px;
  59. }
  60. .bootstrap-switch.bootstrap-switch-large {
  61. min-width: 120px;
  62. }
  63. .bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,
  64. .bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,
  65. .bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label {
  66. font-size: 14px;
  67. line-height: normal;
  68. padding-top: 9px;
  69. padding-bottom: 9px;
  70. }
  71. .bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
  72. -webkit-transition: margin-left .5s;
  73. transition: margin-left .5s;
  74. }
  75. .bootstrap-switch.bootstrap-switch-on .bootstrap-switch-container {
  76. margin-left: 0;
  77. }
  78. .bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label {
  79. border-top-right-radius: 3px;
  80. border-bottom-right-radius: 3px;
  81. }
  82. .bootstrap-switch.bootstrap-switch-off .bootstrap-switch-container {
  83. margin-left: -50%;
  84. }
  85. .bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label {
  86. border-top-left-radius: 3px;
  87. border-bottom-left-radius: 3px;
  88. }
  89. .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-container {
  90. margin-left: -25%;
  91. }
  92. .bootstrap-switch.bootstrap-switch-disabled,
  93. .bootstrap-switch.bootstrap-switch-readonly,
  94. .bootstrap-switch.bootstrap-switch-indeterminate {
  95. cursor: default !important;
  96. opacity: .5;
  97. filter: alpha(opacity=50);
  98. }
  99. .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,
  100. .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,
  101. .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,
  102. .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,
  103. .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,
  104. .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,
  105. .bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,
  106. .bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label,
  107. .bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label {
  108. cursor: default !important;
  109. }
  110. .bootstrap-switch.bootstrap-switch-focused {
  111. border-color: #ccc;
  112. outline: 0;
  113. }
  114. .bootstrap-switch .bootstrap-switch-container {
  115. top: 0;
  116. display: inline-block;
  117. width: 150%;
  118. -webkit-transform: translate3d(0, 0, 0);
  119. transform: translate3d(0, 0, 0);
  120. border-radius: 4px;
  121. }
  122. .bootstrap-switch .bootstrap-switch-handle-on,
  123. .bootstrap-switch .bootstrap-switch-handle-off,
  124. .bootstrap-switch .bootstrap-switch-label {
  125. font-size: 12px;
  126. line-height: 20px;
  127. text-transform: uppercase;
  128. display: inline-block !important;
  129. -webkit-box-sizing: border-box;
  130. -moz-box-sizing: border-box;
  131. box-sizing: border-box;
  132. height: 100%;
  133. padding-top: 4px;
  134. padding-bottom: 4px;
  135. cursor: pointer;
  136. }
  137. .bootstrap-switch .bootstrap-switch-handle-on,
  138. .bootstrap-switch .bootstrap-switch-handle-off {
  139. z-index: 1;
  140. width: 33.333333333%;
  141. text-align: center;
  142. }
  143. .bootstrap-switch .bootstrap-switch-label {
  144. z-index: 100;
  145. width: 33.333333333%;
  146. margin-top: -1px;
  147. margin-bottom: -1px;
  148. text-align: center;
  149. color: #333;
  150. background: #fff;
  151. }
  152. .bootstrap-switch input[type='radio'],
  153. .bootstrap-switch input[type='checkbox'] {
  154. position: absolute !important;
  155. z-index: -1;
  156. top: 0;
  157. left: 0;
  158. opacity: 0;
  159. filter: alpha(opacity=0);
  160. }
  161. .bootstrap-switch input[type='radio'].form-control,
  162. .bootstrap-switch input[type='checkbox'].form-control {
  163. height: auto;
  164. }
  165. /* Input switch alternate */
  166. div.switch-toggle {
  167. display: block;
  168. height: 24px;
  169. width: 48px;
  170. position: relative;
  171. cursor: pointer;
  172. background: #fff;
  173. box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.2);
  174. -webkit-transition: all .2s ease;
  175. -moz-transition: all .2s ease;
  176. -o-transition: all .2s ease;
  177. transition: all .2s ease;
  178. border-radius: 50px;
  179. }
  180. div.switch-toggle:after {
  181. content: '';
  182. display: block;
  183. height: 18px;
  184. width: 18px;
  185. background: #fff;
  186. position: absolute;
  187. top: 3px;
  188. left: 3px;
  189. border-radius: 50px;
  190. box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  191. -webkit-transition: all .2s ease;
  192. -moz-transition: all .2s ease;
  193. -o-transition: all .2s ease;
  194. transition: all .2s ease;
  195. }
  196. div.switch-toggle:before {
  197. content: '';
  198. position: absolute;
  199. right: 1px;
  200. top: 12px;
  201. color: #fff;
  202. }
  203. div.switch-toggle:hover:after {
  204. left: 5px;
  205. }
  206. div.switch-toggle.switch-on:before {
  207. content: '';
  208. right: 40px;
  209. }
  210. .switch-toggle.switch-on {
  211. background: #0c0;
  212. }
  213. div.switch-toggle.switch-on:after {
  214. left: 26px;
  215. }
  216. div.switch-toggle.switch-on:hover:after {
  217. left: 24px;
  218. }