]> git.openstreetmap.org Git - rails.git/commitdiff
Use named arguments for button-variant mixins
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 31 Aug 2022 13:40:01 +0000 (14:40 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 31 Aug 2022 13:42:03 +0000 (14:42 +0100)
This is much clearer than relying on positional arguments, and is
also required for future upgrades to bootstrap.

app/assets/stylesheets/common.scss

index 9ec7fb3f4f14f6a2ad429738f44051cd26560484..ad0cf48efff64566be9e6a4ec46c961a670bb480 100644 (file)
@@ -145,7 +145,7 @@ header {
 
 nav.primary {
   .btn-outline-primary {
-    @include button-outline-variant($green, $white);
+    @include button-outline-variant($green, $color-hover: $white, $active-color: $white);
   }
 
   .disabled {
@@ -190,21 +190,18 @@ nav.secondary {
 
   .login-menu {
     .btn-outline-secondary {
-      @include button-outline-variant($darkgrey, $white, null, null, $white);
+      @include button-outline-variant($darkgrey, $color-hover: $white, $active-color: $white);
     }
   }
 
   .user-menu {
     .btn-outline-secondary {
-      @include button-outline-variant($darkgrey, $darkgrey, white, $darkgrey);
+      @include button-outline-variant($darkgrey, $color-hover: $darkgrey, $active-background: white, $active-border: $darkgrey);
       border-color: $grey;
       &:hover {
         border-color: $grey;
       }
     }
-    &.show .btn-outline-secondary {
-      background-color: white;
-    }
   }
 
   #inboxanchor {
@@ -650,15 +647,15 @@ legend {
    reconsider our colours at some point with that in mind. */
 
 .btn-primary {
-  @include button-variant($primary, $primary, $white, null, null, $white, null, null, $white, null, null, $white);
+  @include button-variant($primary, $primary, $color: $white, $hover-color: $white, $active-color: $white, $disabled-color: $white);
 }
 
 .btn-secondary {
-  @include button-variant($secondary, $secondary, $white, null, null, $white, null, null, $white, null, null, $white);
+  @include button-variant($secondary, $secondary, $color: $white, $hover-color: $white, $active-color: $white, $disabled-color: $white);
 }
 
 .btn-outline-secondary {
-  @include button-outline-variant($secondary, $white, null, null, $white);
+  @include button-outline-variant($secondary, $color-hover: $white, $active-color: $white);
 }
 
 /* Rules for the search and direction forms */