changeset 7077:b9e280001526

less: use default navbar style and only use custom style for select2 elements
author domruf <dominikruf@gmail.com>
date Fri, 27 Oct 2017 20:34:16 +0200
parents 898026fdd3ca
children 0b18670d5864
files kallithea/public/less/kallithea-select2.less kallithea/public/less/style.less
diffstat 2 files changed, 29 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/public/less/kallithea-select2.less	Fri Oct 27 20:13:39 2017 +0200
+++ b/kallithea/public/less/kallithea-select2.less	Fri Oct 27 20:34:16 2017 +0200
@@ -1,7 +1,3 @@
-#context-bar .select2-container .select2-choice .select2-chosen,
-nav.navbar #quick .select2-container .select2-choice .select2-chosen {
-  margin-right: 0;
-}
 .branch-switcher,
 .repo-switcher {
   .select2-choice {
@@ -16,6 +12,10 @@
     box-shadow: none !important;
     color: #FFFFFF !important;
   }
+  .select2-choice .select2-chosen {
+    margin-right: 0;
+    line-height: @line-height-computed;
+  }
   .select2-arrow {
     display: none !important;
   }
@@ -33,7 +33,29 @@
 }
 .repo-switcher-dropdown.select2-drop.select2-drop-active {
   color: black;
+  .select2-result.select2-highlighted {
+    color: @navbar-inverse-link-hover-color;
+    background-color: @navbar-inverse-link-hover-bg;
+  }
+  .select2-result-label {
+    color: white;
+  }
 }
-.repo-switcher-dropdown.select2-drop.select2-drop-active .select2-result-label {
-  color: white;
+
+/* fix padding of select2 entries in navbar to match .navbar-nav > li > a */
+.navbar-inverse {
+  .navbar-nav {
+    > li > .select2-container a {
+      padding: @nav-link-padding;
+      padding-top:    @navbar-padding-vertical;
+      padding-bottom: @navbar-padding-vertical;
+    }
+    li.active > .select2-container,
+    .select2-container:hover,
+    .select2-container:focus,
+    .select2-container-active {
+      color: @navbar-inverse-link-hover-color;
+      background-color: @navbar-inverse-link-hover-bg;
+    }
+  }
 }
--- a/kallithea/public/less/style.less	Fri Oct 27 20:13:39 2017 +0200
+++ b/kallithea/public/less/style.less	Fri Oct 27 20:34:16 2017 +0200
@@ -1023,16 +1023,6 @@
 .linenos a { text-decoration: none; }
 
 /* Stylesheets for the context bar */
-.repo-switcher-dropdown.select2-drop.select2-drop-active .select2-results .select2-highlighted,
-ul.dropdown-menu li a:focus,
-nav.navbar #quick li:hover,
-#quick_login > .pull-right .list-group-item:hover,
-#context-pages li:hover,
-nav.navbar #quick li.active,
-nav.navbar #quick li a.menu_link:focus,
-#context-pages li.active {
-  background: linear-gradient(to bottom, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.1) 100%); /* W3C */
-}
 #quick_login > .pull-right .list-group-item {
   background-color: #577632;
   border: 0;
@@ -1043,10 +1033,6 @@
 }
 
 nav.navbar #quick > li > a,
-nav.navbar #quick .select2-container .select2-choice .select2-chosen,
-#context-pages > ul > li > a,
-#context-pages .select2-container .select2-choice .select2-chosen {
-  padding: 0 15px 0 15px;
-  line-height: @navbar-height;
+#context-pages > ul > li > a {
   height: @navbar-height;
 }