Browse Source

Added stylelint and fixed the css error

zhixin 6 years ago
parent
commit
6920f101f7
3 changed files with 117 additions and 109 deletions
  1. 3 0
      .stylelintrc
  2. 5 1
      package.json
  3. 109 108
      src/themes/theme.scss

+ 3 - 0
.stylelintrc

@@ -0,0 +1,3 @@
+{
+  'extends': 'stylelint-config-standard'
+}

+ 5 - 1
package.json

@@ -24,10 +24,14 @@
     "rollup-plugin-node-resolve": "^4.0.1",
     "rollup-plugin-vue": "^5.0.0",
     "sass": "^1.16.1",
+    "stylelint": "^10.1.0",
+    "stylelint-config-standard": "^18.3.0",
     "vue-template-compiler": "^2.6.10"
   },
   "scripts": {
-    "lint": "eslint src",
+    "lint:js": "eslint src",
+    "lint:css": "stylelint src/**/*.scss",
+    "lint": "run-s lint:*",
     "js:build:base": "rollup -c",
     "js:build:min": "NODE_ENV=production rollup -c",
     "js:build:banner": "find dist -name '*.min.js' -exec headr {} -o {} --version --homepage --author --license \\;",

+ 109 - 108
src/themes/theme.scss

@@ -1,6 +1,6 @@
 .bootstrap-table {
   .fixed-table-toolbar {
-    &:after {
+    &::after {
       content: "";
       display: block;
       clear: both;
@@ -19,6 +19,10 @@
         display: inline-block;
         margin-left: -1px !important;
 
+        > .btn {
+          border-radius: 0;
+        }
+
         &:first-child > .btn {
           border-top-left-radius: 4px;
           border-bottom-left-radius: 4px;
@@ -28,10 +32,6 @@
           border-top-right-radius: 4px;
           border-bottom-right-radius: 4px;
         }
-
-        > .btn {
-          border-radius: 0;
-        }
       }
 
       .dropdown-menu {
@@ -54,6 +54,7 @@
     .columns-left {
       margin-right: 5px;
     }
+
     .columns-right {
       margin-left: 5px;
     }
@@ -68,6 +69,92 @@
     position: relative;
     clear: both;
 
+    .table {
+      width: 100%;
+      margin-bottom: 0 !important;
+
+      th,
+      td {
+        vertical-align: middle;
+        box-sizing: border-box;
+      }
+
+      thead th {
+        vertical-align: bottom;
+        padding: 0;
+        margin: 0;
+
+        &:focus {
+          outline: 0 solid transparent;
+        }
+
+        &.detail {
+          width: 30px;
+        }
+
+        .th-inner {
+          padding: 0.75rem;
+          vertical-align: bottom;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+        }
+
+        .sortable {
+          cursor: pointer;
+          background-position: right;
+          background-repeat: no-repeat;
+          padding-right: 30px;
+        }
+
+        .both {
+          background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC');
+        }
+
+        .asc {
+          background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==');
+        }
+
+        .desc {
+          background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII= ');
+        }
+      }
+
+      tbody tr {
+        &.selected td {
+          background-color: $hover-bg;
+        }
+
+        &.no-records-found {
+          text-align: center;
+        }
+
+        .card-view {
+          display: flex;
+
+          .card-view-title {
+            font-weight: bold;
+            display: inline-block;
+            min-width: 30%;
+            text-align: left !important;
+          }
+        }
+      }
+
+      .bs-checkbox {
+        text-align: center;
+      }
+
+      input[type="radio"],
+      input[type="checkbox"] {
+        margin: 0 auto !important;
+      }
+
+      &.table-sm .th-inner {
+        padding: 0.3rem;
+      }
+    }
+
     &.fixed-height {
       &:not(.has-footer) {
         border-bottom: 1px solid $border-color;
@@ -132,8 +219,8 @@
           }
 
           .animation-dot,
-          .animation-wrap:after,
-          .animation-wrap:before {
+          .animation-wrap::after,
+          .animation-wrap::before {
             content: "";
             animation-duration: 1.5s;
             animation-iteration-count: infinite;
@@ -148,11 +235,11 @@
           }
 
           .animation-dot {
-            animation-delay: .3s;
+            animation-delay: 0.3s;
           }
 
-          .animation-wrap:after{
-            animation-delay:.6s;
+          .animation-wrap::after {
+            animation-delay: 0.6s;
           }
         }
 
@@ -160,107 +247,21 @@
           background: $color;
 
           .animation-dot,
-          .animation-wrap:after,
-          .animation-wrap:before {
+          .animation-wrap::after,
+          .animation-wrap::before {
             background: $background;
           }
         }
       }
     }
 
-    .table {
-      width: 100%;
-      margin-bottom: 0 !important;
-
-      th,
-      td {
-        vertical-align: middle;
-        box-sizing: border-box;
-      }
-
-      thead th {
-        vertical-align: bottom;
-        padding: 0;
-        margin: 0;
-
-        &:focus {
-          outline: 0 solid transparent;
-        }
-
-        &.detail {
-          width: 30px;
-        }
-
-        .th-inner {
-          padding: .75rem;
-          vertical-align: bottom;
-          overflow: hidden;
-          text-overflow: ellipsis;
-          white-space: nowrap;
-        }
-
-        .sortable {
-          cursor: pointer;
-          background-position: right;
-          background-repeat: no-repeat;
-          padding-right: 30px;
-        }
-
-        .both {
-          background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC');
-        }
-
-        .asc {
-          background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==');
-        }
-
-        .desc {
-          background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII= ');
-        }
-      }
-
-      tbody tr {
-        &.selected td {
-          background-color: $hover-bg;
-        }
-
-        &.no-records-found {
-          text-align: center;
-        }
-
-        .card-view {
-          display: flex;
-
-          .card-view-title {
-            font-weight: bold;
-            display: inline-block;
-            min-width: 30%;
-            text-align: left !important;
-          }
-        }
-      }
-
-      .bs-checkbox {
-        text-align: center;
-      }
-
-      input[type="radio"],
-      input[type="checkbox"] {
-        margin: 0 auto !important;
-      }
-
-      &.table-sm .th-inner {
-        padding: .3rem;
-      }
-    }
-
     .fixed-table-footer {
       overflow: hidden;
     }
   }
 
   .fixed-table-pagination {
-    &:after {
+    &::after {
       content: "";
       display: block;
       clear: both;
@@ -304,15 +305,15 @@
 
         li.page-intermediate {
           a {
-            &:before {
+            &::before {
               content: '\2B05';
             }
 
-            &:after {
+            &::after {
               content: '\27A1';
             }
 
-            color:#c8c8c8;
+            color: #c8c8c8;
           }
         }
 
@@ -329,8 +330,8 @@
     top: 0;
     left: 0;
     z-index: 1050;
-    width: 100%!important;
-    background: #FFF;
+    width: 100% !important;
+    background: #fff;
   }
 }
 
@@ -349,8 +350,8 @@ div.fixed-table-scroll-outer {
   overflow: hidden;
 }
 
-@keyframes LOADING{
-  0% { opacity:0; }
-  50% { opacity:1; }
-  to { opacity:0; }
+@keyframes LOADING {
+  0% { opacity: 0; }
+  50% { opacity: 1; }
+  to { opacity: 0; }
 }