Browse Source

优化多选下拉列表初始化样式

Karson 5 years ago
parent
commit
84a181be73

+ 21 - 2
public/assets/css/backend.css

@@ -153,9 +153,28 @@ select.selectpicker {
   max-height: 31px;
   max-height: 31px;
   overflow: hidden;
   overflow: hidden;
 }
 }
-select.bs-select-hidden[multiple] > option,
-select.selectpicker[multiple] > option {
+select.bs-select-hidden[multiple],
+select.selectpicker[multiple] {
   height: 31px;
   height: 31px;
+  padding: 0;
+  background: #f4f4f4;
+}
+select.bs-select-hidden[multiple] option,
+select.selectpicker[multiple] option {
+  color: #f4f4f4;
+  zoom: 1;
+  filter: alpha(opacity=0);
+  -webkit-opacity: 0;
+  -moz-opacity: 0;
+  opacity: 0;
+}
+@media not all and (min-resolution: 0.001dpcm) {
+  @supports (-webkit-appearance:none) {
+    select.bs-select-hidden[multiple],
+    select.selectpicker[multiple] {
+      visibility: hidden;
+    }
+  }
 }
 }
 .img-center {
 .img-center {
   margin: 0 auto;
   margin: 0 auto;

File diff suppressed because it is too large
+ 1 - 1
public/assets/css/backend.min.css


+ 17 - 2
public/assets/less/backend.less

@@ -197,8 +197,23 @@ select.bs-select-hidden, select.selectpicker {
   display: inherit !important;
   display: inherit !important;
   max-height: 31px;
   max-height: 31px;
   overflow: hidden;
   overflow: hidden;
-  &[multiple] > option {
-    height:31px;
+
+  &[multiple] {
+    height: 31px;
+    //visibility: hidden;
+    padding: 0;
+    background: #f4f4f4;
+
+    option {
+      color: #f4f4f4;
+      .opacity(0);
+    }
+
+    @media not all and (min-resolution: .001dpcm) {
+      @supports (-webkit-appearance:none) {
+        visibility: hidden;
+      }
+    }
   }
   }
 }
 }