bootstrap-switch.css 4.5 KB

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