bootstrap-switch.css 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. -webkit-transform: translate3d(0, 0, 0);
  111. transform: translate3d(0, 0, 0);
  112. }
  113. .has-switch input[type=radio],
  114. .has-switch input[type=checkbox] {
  115. display: none;
  116. }
  117. .has-switch span,
  118. .has-switch label {
  119. -webkit-box-sizing: border-box;
  120. -moz-box-sizing: border-box;
  121. box-sizing: border-box;
  122. cursor: pointer;
  123. position: relative;
  124. display: inline-block !important;
  125. height: 100%;
  126. padding-bottom: 4px;
  127. padding-top: 4px;
  128. font-size: 14px;
  129. line-height: 20px;
  130. }
  131. .has-switch label {
  132. text-align: center;
  133. margin-top: -1px;
  134. margin-bottom: -1px;
  135. z-index: 100;
  136. width: 34%;
  137. background: #ffffff;
  138. }
  139. .has-switch label i {
  140. color: #000;
  141. text-shadow: 0 1px 0 #fff;
  142. line-height: 18px;
  143. pointer-events: none;
  144. }
  145. .has-switch span {
  146. text-align: center;
  147. z-index: 1;
  148. width: 33%;
  149. }
  150. .has-switch span.switch-left {
  151. color: #f00;
  152. border-bottom-left-radius: 4px;
  153. border-top-left-radius: 4px;
  154. }
  155. .has-switch span.switch-right {
  156. color: #000;
  157. background: #eeeeee;
  158. }
  159. .has-switch span.switch-primary,
  160. .has-switch span.switch-left {
  161. color: #fff;
  162. background: #428bca;
  163. }
  164. .has-switch span.switch-info {
  165. color: #fff;
  166. background: #5bc0de;
  167. }
  168. .has-switch span.switch-success {
  169. color: #fff;
  170. background: #5cb85c;
  171. }
  172. .has-switch span.switch-warning {
  173. background: #f0ad4e;
  174. color: #fff;
  175. }
  176. .has-switch span.switch-danger {
  177. color: #fff;
  178. background: #d9534f;
  179. }
  180. .has-switch span.switch-default {
  181. color: #000;
  182. background: #eeeeee;
  183. }