_bootstrap-switch.scss 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. .bootstrap-switch {
  2. display: inline-block;
  3. direction: ltr;
  4. cursor: pointer;
  5. border-radius: 30px;
  6. border: 0;
  7. position: relative;
  8. text-align: left;
  9. overflow: hidden;
  10. margin-bottom: 5px;
  11. margin-left: 66px;
  12. line-height: 8px;
  13. width: 61px !important;
  14. height: 26px;
  15. outline: none;
  16. z-index: 0;
  17. margin-right: 1px;
  18. -webkit-user-select: none;
  19. -moz-user-select: none;
  20. -ms-user-select: none;
  21. user-select: none;
  22. vertical-align: middle;
  23. -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
  24. transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
  25. }
  26. .bootstrap-switch .bootstrap-switch-container {
  27. display: inline-flex;
  28. top: 0;
  29. height: 26px;
  30. border-radius: 4px;
  31. -webkit-transform: translate3d(0, 0, 0);
  32. transform: translate3d(0, 0, 0);
  33. width: 100px !important;
  34. }
  35. .bootstrap-switch .bootstrap-switch-handle-on,
  36. .bootstrap-switch .bootstrap-switch-handle-off,
  37. .bootstrap-switch .bootstrap-switch-label {
  38. -webkit-box-sizing: border-box;
  39. -moz-box-sizing: border-box;
  40. box-sizing: border-box;
  41. cursor: pointer;
  42. display: inline-block !important;
  43. height: 100%;
  44. color: #fff;
  45. padding: 6px 10px;
  46. font-size: 11px;
  47. text-indent: -5px;
  48. line-height: 15px;
  49. -webkit-transition: 0.25s ease-out;
  50. transition: 0.25s ease-out;
  51. i{
  52. font-size: 12px;
  53. line-height: 14px;
  54. }
  55. }
  56. .bootstrap-switch .bootstrap-switch-handle-on,
  57. .bootstrap-switch .bootstrap-switch-handle-off {
  58. text-align: center;
  59. z-index: 1;
  60. float: left;
  61. width: 50% !important;
  62. background-color: $info-color;
  63. }
  64. .bootstrap-switch .bootstrap-switch-label {
  65. text-align: center;
  66. z-index: 100;
  67. color: #333333;
  68. background: #ffffff;
  69. width: 22px !important;
  70. height: 22px;
  71. margin: 2px -11px;
  72. border-radius: 12px;
  73. position: relative;
  74. float: left;
  75. padding: 0;
  76. background-color: #FFFFFF;
  77. box-shadow: 0 1px 1px #FFFFFF inset, 0 1px 1px rgba(0, 0, 0, 0.25);
  78. }
  79. .bootstrap-switch .bootstrap-switch-handle-on {
  80. border-bottom-left-radius: 3px;
  81. border-top-left-radius: 3px;
  82. }
  83. .bootstrap-switch .bootstrap-switch-handle-off {
  84. text-indent: 6px;
  85. }
  86. .bootstrap-switch input[type='radio'],
  87. .bootstrap-switch input[type='checkbox'] {
  88. position: absolute !important;
  89. top: 0;
  90. left: 0;
  91. opacity: 0;
  92. filter: alpha(opacity=0);
  93. z-index: -1;
  94. }
  95. .bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
  96. -webkit-transition: margin-left 0.5s;
  97. transition: margin-left 0.5s;
  98. }
  99. .bootstrap-switch.bootstrap-switch-on .bootstrap-switch-container {
  100. margin-left: -2px !important;
  101. }
  102. .bootstrap-switch.bootstrap-switch-off .bootstrap-switch-container {
  103. margin-left: -37px !important;
  104. }
  105. .bootstrap-switch.bootstrap-switch-on:hover .bootstrap-switch-label {
  106. width: 26px !important;
  107. margin: 2px -15px;
  108. }
  109. .bootstrap-switch.bootstrap-switch-off:hover .bootstrap-switch-label {
  110. width: 26px !important;
  111. margin: 2px -15px -13px -11px;
  112. }