浏览代码

Merge pull request #559 from Julusian/vanilla-css-backports

Various CSS fixes
Emanuele Marchi 8 年之前
父节点
当前提交
2626852d85
共有 2 个文件被更改,包括 12 次插入3 次删除
  1. 5 1
      src/less/bootstrap2/bootstrap-switch.less
  2. 7 2
      src/less/bootstrap3/bootstrap-switch.less

+ 5 - 1
src/less/bootstrap2/bootstrap-switch.less

@@ -29,7 +29,6 @@
     .box-sizing(border-box);
     cursor: pointer;
     display: inline-block !important;
-    height: 100%;
     padding-top: 4px;
     padding-bottom: 4px;
     padding-left: 8px;
@@ -78,6 +77,10 @@
     .buttonBackground(@btnBackground, @btnBackgroundHighlight, @grayDark);
   }
 
+  span::before {
+    content: "\200b";
+  }
+
   .@{bootstrap-switch-base}-handle-on {
     .border-left-radius(4px);
   }
@@ -93,6 +96,7 @@
     left: 0;
     .opacity(0);
     z-index: -1;
+    visibility: hidden;
 
     &.form-control {
       height: auto;

+ 7 - 2
src/less/bootstrap3/bootstrap-switch.less

@@ -28,8 +28,8 @@
   .@{bootstrap-switch-base}-label {
     .box-sizing(border-box);
     cursor: pointer;
-    display: inline-block !important;
-    height: 100%;
+    display: table-cell;
+    vertical-align: middle;
     padding: @padding-base-vertical @padding-base-horizontal;
     font-size: @font-size-base;
     line-height: @line-height-computed;
@@ -80,6 +80,10 @@
     background: @btn-default-bg;
   }
 
+  span::before {
+    content: "\200b";
+  }
+
   .@{bootstrap-switch-base}-handle-on {
     .border-left-radius(@border-radius-base - 1);
   }
@@ -96,6 +100,7 @@
     margin: 0;
     z-index: -1;
     .opacity(0);
+    visibility: hidden;
   }
 
   &.@{bootstrap-switch-base}-mini {