Przeglądaj źródła

reorganize scss for page-editor-mode-manager

Yuki Takei 5 lat temu
rodzic
commit
020577da8e

+ 2 - 47
src/client/styles/scss/_mixins.scss

@@ -227,7 +227,7 @@
   transition-duration: 300ms;
   transition-duration: 300ms;
 }
 }
 
 
-@mixin border-vertical($beforeOrAfter, $borderColor, $borderLength, $zIndex: initial, $isBtnGroup: false) {
+@mixin border-vertical($beforeOrAfter, $borderLength, $zIndex: initial, $isBtnGroup: false) {
   position: relative;
   position: relative;
   @if $isBtnGroup {
   @if $isBtnGroup {
     &:not(:first-child) {
     &:not(:first-child) {
@@ -248,53 +248,8 @@
       height: $borderLength;
       height: $borderLength;
       margin-left: -0.5px;
       margin-left: -0.5px;
       content: '';
       content: '';
-      border-left: 1px solid $borderColor;
+      border-left: 1px solid transparent;
       transition: border-color 0.15s ease-in-out;
       transition: border-color 0.15s ease-in-out;
     }
     }
   }
   }
 }
 }
-
-@mixin page-editor-mode-manager($textColor, $borderColor, $bgColorHoverAndActive, $bgColor: white) {
-  width: 70px;
-  color: $textColor;
-  white-space: nowrap;
-  background-color: $bgColor;
-  border-color: $borderColor;
-
-  @include border-vertical('before', $borderColor, 70%, 1, true);
-
-  &.view-button,
-  &.edit-button {
-    line-height: 1.2rem;
-    .grw-page-editor-mode-manager-icon {
-      @include media-breakpoint-down(sm) {
-        font-size: 1.2rem;
-      }
-    }
-  }
-  &.hackmd-button {
-    line-height: 1.2rem;
-    .grw-page-editor-mode-manager-icon {
-      @include media-breakpoint-down(sm) {
-        font-size: 1.2rem;
-      }
-    }
-    .grw-page-editor-mode-manager-label {
-      font-size: 12px;
-      letter-spacing: -0.6px;
-    }
-  }
-  &:hover,
-  &:active,
-  &.active {
-    color: $textColor;
-    background-color: $bgColorHoverAndActive;
-    border-color: $borderColor;
-    &::after {
-      border-color: $bgColorHoverAndActive;
-    }
-  }
-  &:not(:disabled):not(.disabled):focus {
-    box-shadow: none;
-  }
-}

+ 32 - 0
src/client/styles/scss/molecules/page-editor-mode-manager.scss

@@ -0,0 +1,32 @@
+// @mixin page-editor-mode-manager($textColor, $borderColor, $bgColorHoverAndActive, $bgColor: white) {
+.grw-page-editor-mode-manager .btn {
+  width: 70px;
+  white-space: nowrap;
+
+  @include border-vertical('before', 70%, 1, true);
+
+  &.view-button,
+  &.edit-button {
+    line-height: 1.2rem;
+    .grw-page-editor-mode-manager-icon {
+      @include media-breakpoint-down(sm) {
+        font-size: 1.2rem;
+      }
+    }
+  }
+  &.hackmd-button {
+    line-height: 1.2rem;
+    .grw-page-editor-mode-manager-icon {
+      @include media-breakpoint-down(sm) {
+        font-size: 1.2rem;
+      }
+    }
+    .grw-page-editor-mode-manager-label {
+      font-size: 12px;
+      letter-spacing: -0.6px;
+    }
+  }
+  &:not(:disabled):not(.disabled):focus {
+    box-shadow: none;
+  }
+}

+ 1 - 0
src/client/styles/scss/style-app.scss

@@ -23,6 +23,7 @@
 
 
 // molecules
 // molecules
 @import 'molecules/copy-dropdown';
 @import 'molecules/copy-dropdown';
+@import 'molecules/page-editor-mode-manager';
 @import 'molecules/slack-notification';
 @import 'molecules/slack-notification';
 
 
 // growi component
 // growi component

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

@@ -33,6 +33,7 @@ $nav-tabs-link-active-border-color: $bordercolor-nav-tabs-active;
 @import '~bootstrap/scss/mixins';
 @import '~bootstrap/scss/mixins';
 @import '../mixins';
 @import '../mixins';
 @import 'mixins/list-group';
 @import 'mixins/list-group';
+@import 'mixins/page-editor-mode-manager';
 @import 'mixins/tables'; // comment out and use _reboot-bootstrap-tables instead -- 2020.05.28 Yuki Takei
 @import 'mixins/tables'; // comment out and use _reboot-bootstrap-tables instead -- 2020.05.28 Yuki Takei
 @import 'reboot-bootstrap-colors';
 @import 'reboot-bootstrap-colors';
 @import 'reboot-bootstrap-theme-colors';
 @import 'reboot-bootstrap-theme-colors';

+ 1 - 1
src/client/styles/scss/theme/antarctic.scss

@@ -116,7 +116,7 @@ html[dark] {
   //Button
   //Button
   .btn-group.grw-page-editor-mode-manager {
   .btn-group.grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager(darken($primary, 10%), lighten($primary, 55%), lighten($primary, 60%));
+      @include btn-page-editor-mode-manager(darken($primary, 10%), lighten($primary, 55%), lighten($primary, 60%));
     }
     }
   }
   }
 
 

+ 1 - 1
src/client/styles/scss/theme/christmas.scss

@@ -187,7 +187,7 @@ html[dark] {
   // Button
   // Button
   .grw-page-editor-mode-manager {
   .grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager(darken($subthemecolor, 15%), lighten($subthemecolor, 35%), lighten($subthemecolor, 45%));
+      @include btn-page-editor-mode-manager(darken($subthemecolor, 15%), lighten($subthemecolor, 35%), lighten($subthemecolor, 45%));
     }
     }
   }
   }
 }
 }

+ 2 - 2
src/client/styles/scss/theme/default.scss

@@ -107,7 +107,7 @@ html[light] {
   // Button
   // Button
   .btn-group.grw-page-editor-mode-manager {
   .btn-group.grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager($primary, lighten($primary, 65%), lighten($primary, 70%));
+      @include btn-page-editor-mode-manager($primary, lighten($primary, 65%), lighten($primary, 70%));
     }
     }
   }
   }
 }
 }
@@ -207,7 +207,7 @@ html[dark] {
   //Button
   //Button
   .btn-group.grw-page-editor-mode-manager {
   .btn-group.grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager(lighten($primary, 30%), lighten($primary, 20%), $primary, darken($primary, 20%));
+      @include btn-page-editor-mode-manager(lighten($primary, 30%), lighten($primary, 20%), $primary, darken($primary, 20%));
     }
     }
   }
   }
 }
 }

+ 1 - 1
src/client/styles/scss/theme/future.scss

@@ -92,7 +92,7 @@ html[dark] {
   //Button
   //Button
   .btn-group.grw-page-editor-mode-manager {
   .btn-group.grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager(lighten($primary, 10%), $primary, darken($primary, 10%), darken($primary, 20%));
+      @include btn-page-editor-mode-manager(lighten($primary, 10%), $primary, darken($primary, 10%), darken($primary, 20%));
     }
     }
   }
   }
 
 

+ 1 - 1
src/client/styles/scss/theme/halloween.scss

@@ -110,7 +110,7 @@ html[dark] {
   //Button
   //Button
   .btn-group.grw-page-editor-mode-manager {
   .btn-group.grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager(lighten($primary, 35%), $primary, lighten($primary, 5%), darken($primary, 20%));
+      @include btn-page-editor-mode-manager(lighten($primary, 35%), $primary, lighten($primary, 5%), darken($primary, 20%));
     }
     }
   }
   }
 
 

+ 1 - 1
src/client/styles/scss/theme/island.scss

@@ -112,7 +112,7 @@ html[dark] {
   // Button
   // Button
   .btn-group.grw-page-editor-mode-manager {
   .btn-group.grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager(darken($primary, 50%), lighten($primary, 5%), darken($primary, 5%));
+      @include btn-page-editor-mode-manager(darken($primary, 50%), lighten($primary, 5%), darken($primary, 5%));
     }
     }
   }
   }
 }
 }

+ 1 - 1
src/client/styles/scss/theme/kibela.scss

@@ -111,7 +111,7 @@ html[dark] {
   //Button
   //Button
   .grw-page-editor-mode-manager {
   .grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager(darken($primary, 15%), lighten($primary, 45%), lighten($primary, 50%));
+      @include btn-page-editor-mode-manager(darken($primary, 15%), lighten($primary, 45%), lighten($primary, 50%));
     }
     }
   }
   }
 }
 }

+ 22 - 0
src/client/styles/scss/theme/mixins/_page-editor-mode-manager.scss

@@ -0,0 +1,22 @@
+@mixin btn-page-editor-mode-manager($textColor, $borderColor, $bgColorHoverAndActive, $bgColor: white) {
+  color: $textColor;
+  background-color: $bgColor;
+  border-color: $borderColor;
+
+  &:not(:first-child) {
+    &::before {
+      border-left-color: $borderColor;
+    }
+  }
+
+  &:hover,
+  &:active,
+  &.active {
+    color: $textColor;
+    background-color: $bgColorHoverAndActive;
+    border-color: $borderColor;
+    &::after {
+      border-color: $bgColorHoverAndActive;
+    }
+  }
+}

+ 2 - 2
src/client/styles/scss/theme/mono-blue.scss

@@ -91,7 +91,7 @@ html[light] {
   // Button
   // Button
   .btn-group.grw-page-editor-mode-manager {
   .btn-group.grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager($primary, lighten($primary, 65%), lighten($primary, 70%));
+      @include btn-page-editor-mode-manager($primary, lighten($primary, 65%), lighten($primary, 70%));
     }
     }
   }
   }
 }
 }
@@ -199,7 +199,7 @@ html[dark] {
   // Button
   // Button
   .btn-group.grw-page-editor-mode-manager {
   .btn-group.grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager(lighten($primary, 30%), $primary, darken($primary, 10%), darken($primary, 20%));
+      @include btn-page-editor-mode-manager(lighten($primary, 30%), $primary, darken($primary, 10%), darken($primary, 20%));
     }
     }
   }
   }
 }
 }

+ 1 - 1
src/client/styles/scss/theme/nature.scss

@@ -114,7 +114,7 @@ html[dark] {
   // Button
   // Button
   .btn-group.grw-page-editor-mode-manager {
   .btn-group.grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager($bgcolor-navbar, lighten($bgcolor-navbar, 65%), lighten($bgcolor-navbar, 70%));
+      @include btn-page-editor-mode-manager($bgcolor-navbar, lighten($bgcolor-navbar, 65%), lighten($bgcolor-navbar, 70%));
     }
     }
   }
   }
 }
 }

+ 1 - 1
src/client/styles/scss/theme/spring.scss

@@ -100,7 +100,7 @@ html[dark] {
   }
   }
   .btn-group.grw-page-editor-mode-manager {
   .btn-group.grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager(darken($primary, 50%), lighten($primary, 5%), lighten($primary, 10%));
+      @include btn-page-editor-mode-manager(darken($primary, 50%), lighten($primary, 5%), lighten($primary, 10%));
     }
     }
   }
   }
 
 

+ 1 - 1
src/client/styles/scss/theme/wood.scss

@@ -164,7 +164,7 @@ html[dark] {
   // Button
   // Button
   .btn-group.grw-page-editor-mode-manager {
   .btn-group.grw-page-editor-mode-manager {
     .btn.btn-outline-primary {
     .btn.btn-outline-primary {
-      @include page-editor-mode-manager(darken($primary, 30%), lighten($primary, 15%), lighten($primary, 25%));
+      @include btn-page-editor-mode-manager(darken($primary, 30%), lighten($primary, 15%), lighten($primary, 25%));
     }
     }
   }
   }
 }
 }