bootstrap-switch.css 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /* ========================================================================
  2. * bootstrap-switch - v2.0.0
  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. .has-switch {
  22. display: inline-block;
  23. cursor: pointer;
  24. border-radius: 4px;
  25. border: 1px solid;
  26. border-color: #cccccc;
  27. position: relative;
  28. text-align: left;
  29. overflow: hidden;
  30. line-height: 8px;
  31. -webkit-user-select: none;
  32. -moz-user-select: none;
  33. -ms-user-select: none;
  34. -o-user-select: none;
  35. user-select: none;
  36. vertical-align: middle;
  37. min-width: 100px;
  38. -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
  39. transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
  40. }
  41. .has-switch:focus {
  42. border-color: #66afe9;
  43. outline: 0;
  44. -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
  45. box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
  46. }
  47. .has-switch.switch-mini {
  48. min-width: 72px;
  49. }
  50. .has-switch.switch-mini span,
  51. .has-switch.switch-mini label {
  52. padding-bottom: 4px;
  53. padding-top: 4px;
  54. font-size: 10px;
  55. line-height: 9px;
  56. }
  57. .has-switch.switch-mini i.switch-mini-icons {
  58. height: 1.20em;
  59. line-height: 9px;
  60. vertical-align: text-top;
  61. text-align: center;
  62. transform: scale(0.6);
  63. margin-top: -1px;
  64. margin-bottom: -1px;
  65. }
  66. .has-switch.switch-small {
  67. min-width: 80px;
  68. }
  69. .has-switch.switch-small span,
  70. .has-switch.switch-small label {
  71. padding-bottom: 3px;
  72. padding-top: 3px;
  73. font-size: 12px;
  74. line-height: 18px;
  75. }
  76. .has-switch.switch-large {
  77. min-width: 120px;
  78. }
  79. .has-switch.switch-large span,
  80. .has-switch.switch-large label {
  81. padding-bottom: 9px;
  82. padding-top: 9px;
  83. font-size: 16px;
  84. line-height: normal;
  85. }
  86. .has-switch.switch-animate > div {
  87. -webkit-transition: left 0.5s;
  88. transition: left 0.5s;
  89. }
  90. .has-switch.switch-off > div {
  91. left: -50%;
  92. }
  93. .has-switch.switch-on > div {
  94. left: 0%;
  95. }
  96. .has-switch.disabled {
  97. opacity: 0.5;
  98. filter: alpha(opacity=50);
  99. cursor: default !important;
  100. }
  101. .has-switch.disabled span,
  102. .has-switch.disabled label {
  103. cursor: default !important;
  104. }
  105. .has-switch > div {
  106. display: inline-block;
  107. width: 150%;
  108. position: relative;
  109. top: 0;
  110. }
  111. .has-switch input[type=radio],
  112. .has-switch input[type=checkbox] {
  113. display: none;
  114. }
  115. .has-switch span,
  116. .has-switch label {
  117. -webkit-box-sizing: border-box;
  118. -moz-box-sizing: border-box;
  119. box-sizing: border-box;
  120. cursor: pointer;
  121. position: relative;
  122. display: inline-block !important;
  123. height: 100%;
  124. padding-bottom: 4px;
  125. padding-top: 4px;
  126. font-size: 14px;
  127. line-height: 20px;
  128. }
  129. .has-switch label {
  130. text-align: center;
  131. margin-top: -1px;
  132. margin-bottom: -1px;
  133. z-index: 100;
  134. width: 34%;
  135. background: #ffffff;
  136. }
  137. .has-switch label i {
  138. color: #000;
  139. text-shadow: 0 1px 0 #fff;
  140. line-height: 18px;
  141. pointer-events: none;
  142. }
  143. .has-switch span {
  144. text-align: center;
  145. z-index: 1;
  146. width: 33%;
  147. }
  148. .has-switch span.switch-left {
  149. color: #f00;
  150. border-bottom-left-radius: 4px;
  151. border-top-left-radius: 4px;
  152. }
  153. .has-switch span.switch-right {
  154. color: #000;
  155. background: #eeeeee;
  156. }
  157. .has-switch span.switch-primary,
  158. .has-switch span.switch-left {
  159. color: #fff;
  160. background: #428bca;
  161. }
  162. .has-switch span.switch-info {
  163. color: #fff;
  164. background: #5bc0de;
  165. }
  166. .has-switch span.switch-success {
  167. color: #fff;
  168. background: #5cb85c;
  169. }
  170. .has-switch span.switch-warning {
  171. background: #f0ad4e;
  172. color: #fff;
  173. }
  174. .has-switch span.switch-danger {
  175. color: #fff;
  176. background: #d9534f;
  177. }
  178. .has-switch span.switch-default {
  179. color: #000;
  180. background: #eeeeee;
  181. }