Просмотр исходного кода

11 lines reduced by refactoring.

Shu Katabe 5 лет назад
Родитель
Сommit
d83955d2a8

+ 7 - 18
src/client/styles/scss/_mixins.scss

@@ -221,16 +221,16 @@
   transition-duration: 300ms;
 }
 
-@mixin short-border-vertical($borderColor) {
+@mixin border-vertical($beforeOrAfter, $borderColor, $borderLength, $zIndex: initial) {
   position: relative;
   &:not(:first-child) {
-    &::before {
+    &::#{$beforeOrAfter} {
       position: absolute;
-      top: 12.5%;
+      top: calc((100% - #{$borderLength}) / 2);
       left: 0;
-      z-index: 1;
+      z-index: $zIndex;
       width: 100%;
-      height: 75%;
+      height: $borderLength;
       margin-left: -1px;
       content: '';
       border-left: 1px solid $borderColor;
@@ -250,7 +250,7 @@
   background-color: $bgColor;
   border-color: $borderColor;
 
-  @include short-border-vertical($borderColor);
+  @include border-vertical('before', $borderColor, 70%, 1);
 
   &.view-button,
   &.edit-button {
@@ -269,18 +269,7 @@
   &:not(:first-child) {
     margin-left: 0;
     border-left: none;
-    &::after {
-      position: absolute;
-      top: 0;
-      left: 0;
-      z-index: 0;
-      width: 100%;
-      height: 100%;
-      margin-left: -1px;
-      content: '';
-      border-left: 1px solid transparent;
-      transition: border-color 0.15s ease-in-out;
-    }
+    @include border-vertical('after', $bgColor, 100%, 0);
   }
   &:not(:last-child) {
     border-right: none;

+ 1 - 1
src/client/styles/scss/theme/_apply-colors.scss

@@ -274,7 +274,7 @@ pre:not(.hljs):not(.CodeMirror-line) {
     fill: $color-link;
   }
   .grw-seen-user-list {
-    @include short-border-vertical($bordercolor-toc);
+    @include border-vertical('before', $bordercolor-toc, 70%);
 
     .btn {
       color: $color-seen-user;