]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/stylesheets/common.scss
Use svg symbols for routing icons
[rails.git] / app / assets / stylesheets / common.scss
index 31ce7dd28a2e15f4645b4263e30a4eae99bed57f..27cfb465c5ba5180e4c2b6ad3d993db5eb190781 100644 (file)
@@ -1,6 +1,5 @@
 @use "sass:map";
 @import "parameters";
-@import "browse";
 @import "bootstrap";
 @import "rails_bootstrap_forms";
 
@@ -10,6 +9,7 @@
 
 body {
   font-size: $typeheight;
+  --dark-mode-map-filter: none;
 }
 
 time[title] {
@@ -131,10 +131,6 @@ header {
     font-size: 14px;
   }
 
-  nav.primary {
-    margin-right: auto;
-  }
-
   .username {
     max-width: 12em;
   }
@@ -174,7 +170,11 @@ nav.primary {
 
 nav.secondary {
   .nav-link {
-    padding: 0.3rem;
+    padding: 0 0.3rem;
+  }
+
+  > ul {
+    height: 1.5em;
   }
 }
 
@@ -191,15 +191,6 @@ nav.primary, nav.secondary {
   display: none;
 }
 
-body.compact-nav {
-  #compact-secondary-nav {
-    display: inline-block;
-  }
-  .compact-hide {
-    display: none;
-  }
-}
-
 body.small-nav {
   #menu-icon {
     display: block;
@@ -217,6 +208,10 @@ body.small-nav {
     .search_forms {
       display: block;
     }
+
+    .username {
+      max-width: unset;
+    }
   }
 
   #sidebar .search_forms {
@@ -236,6 +231,11 @@ body.small-nav {
   nav.secondary {
     flex-direction: column;
 
+    > ul {
+      height: auto;
+      justify-content: center;
+    }
+
     .user-menu, .login-menu {
       width: 100%;
     }
@@ -336,10 +336,6 @@ body.small-nav {
   #sidebar {
     float: left;
     width: $sidebarWidth;
-
-    #sidebar_loader {
-      display: none;
-    }
   }
 
   .overlay-sidebar #sidebar {
@@ -355,6 +351,7 @@ body.small-nav {
       display: block;
     }
 
+    #sidebar_loader,
     #sidebar_content {
       display: none;
     }
@@ -502,12 +499,7 @@ body.small-nav {
 }
 
 @include color-mode(dark) {
-  .leaflet-tile-container .leaflet-tile,
-  .mapkey-table-entry td:first-child > * {
-    filter: brightness(.8);
-  }
-
-  .leaflet-control-attribution a {
+  .leaflet-container .leaflet-control-attribution a {
     color: var(--bs-link-color);
   }
 
@@ -516,6 +508,27 @@ body.small-nav {
   }
 }
 
+@mixin dark-map-color-scheme {
+  .leaflet-tile-container,
+  .mapkey-table-entry td:first-child > * {
+    filter: var(--dark-mode-map-filter);
+  }
+
+  .leaflet-tile-container .leaflet-tile {
+    filter: none;
+  }
+}
+
+body[data-map-theme="dark"] {
+  @include dark-map-color-scheme;
+}
+
+@include color-mode(dark) {
+  body:not([data-map-theme]) {
+    @include dark-map-color-scheme;
+  }
+}
+
 /* Rules for attribution text under the main map shown on printouts */
 
 .donate-attr { color: darken($green, 10%) !important; }
@@ -576,22 +589,6 @@ header .search_forms,
 
 /* Rules for routing */
 
-div.direction {
-  background-image: image-url('routing-sprite.svg');
-  width: 20px;
-  height: 20px;
-  background-repeat: no-repeat;
-}
-@for $i from 0 through 25 {
-div.direction.i#{$i} { background-position: #{($i)*-20}px 0px; }
-}
-
-@include color-mode(dark) {
-  div.direction {
-    filter: invert(1);
-  }
-}
-
 td.distance {
     font-size: x-small;
 }
@@ -796,9 +793,17 @@ tr.turn {
   }
 }
 
+/* Rules for the issues page */
+
+.issues.issues-index {
+  td.reporting_users {
+    max-width: 5rem;
+  }
+}
+
 /* Rules for the account confirmation page */
 
-.users-terms {
+.accounts-terms-show {
   .legale {
     padding: $lineheight;
     margin-bottom: $lineheight;
@@ -932,13 +937,18 @@ div.secondary-actions {
   }
 }
 
-/* Rules for block pages */
+/* Rules for tables with usernames */
 
+.messages-table .username,
 #block_list .username {
   max-width: 20em;
 }
 
-/* Rules for tabs inside secondary background sections */
+/* Rules for navigation tabs */
+
+.nav-tabs .username {
+  max-width: 20em;
+}
 
 .bg-body-secondary .nav-tabs {
   --bs-border-color: var(--bs-secondary-border-subtle);
@@ -961,30 +971,20 @@ img.trace_image {
 
 /* Rules for map sidebar icons */
 
-.browse-section {
-  .node::before,
-  .way::before,
-  .relation::before {
-    display: inline-block;
-    width: 25px;
-    margin-left: -25px;
-  }
+.browse-section .browse-element-list {
+  line-height: 1.25rem;
 
-  .node, .way, .relation {
-    margin-left: 25px;
+  .browse-icon {
+    height: 1.25rem;
   }
-}
 
-@each $class, $item in $map-sidebar-icons {
-  .browse-section #{$class}::before {
-    content: image-url('browse/#{map.get($item, "filename")}');
+  .d-flex > .browse-icon {
+    height: max(20px, 1.25rem);
   }
 
-  @if map.get($item, "invert") {
-    @include color-mode(dark) {
-      .browse-section #{$class}::before {
-        filter: invert(.8) hue-rotate(180deg);
-      }
+  @include color-mode(dark) {
+    .browse-icon-invertible {
+      filter: invert(.8) hue-rotate(180deg);
     }
   }
 }