Commit ffc0c26b27

Andrew Kelley <andrew@ziglang.org>
2019-10-08 03:03:04
generated docs: highlight active package
1 parent 2e26aaa
Changed files (2)
lib
std
special
lib/std/special/docs/index.html
@@ -94,7 +94,10 @@
         background-color: #555;
         color: #fff;
       }
-
+      #listPkgs li a.active {
+        background-color: #FFBB4D;
+        color: #000;
+      }
       #logo {
         width: 8em;
         padding: 0.5em 1em;
@@ -170,6 +173,10 @@
           background-color: #555;
           color: #fff;
         }
+        #listPkgs li a.active {
+          background-color: #FFBB4D;
+          color: #000;
+        }
         #listSearchResults li.selected {
           background-color: #000;
         }
lib/std/special/docs/main.js
@@ -220,6 +220,11 @@
                 var aDom = liDom.children[0];
                 aDom.textContent = list[i].name;
                 aDom.setAttribute('href', navLinkPkg(list[i].pkg));
+                if (list[i].name === curNav.pkgNames[0]) {
+                    aDom.classList.add("active");
+                } else {
+                    aDom.classList.remove("active");
+                }
             }
 
             domSectPkgs.classList.remove("hidden");