From 5f5d4d331dedc49fe4de1cfa3a6aaf9079a8a3c6 Mon Sep 17 00:00:00 2001 From: Riddhiman Adib Date: Sat, 7 Aug 2021 15:51:48 -0500 Subject: [PATCH] adds submenu in navigation bar. (fixes issue #159) (#334) * adds submenu in navigation bar. (fixes issue #159) * Updated scss files to change hover animations on dropdown submenus, on both dark mode and light mode --- _includes/header.html | 20 ++++++++++++++++++++ _pages/dropdown.md | 12 ++++++++++++ _sass/_base.scss | 18 +++++++++++++++++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 _pages/dropdown.md diff --git a/_includes/header.html b/_includes/header.html index 0712951de5bb..31e1fd2a4b19 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -46,6 +46,25 @@ {% assign sorted_pages = site.pages | sort: "title" %} {% for p in sorted_pages %} {% if p.nav and p.autogen == nil %} + {% if p.dropdown %} + + {% else %} {% endif %} + {% endif %} {% endfor %} {% if site.enable_darkmode %}
diff --git a/_pages/dropdown.md b/_pages/dropdown.md new file mode 100644 index 000000000000..578b3723cf7e --- /dev/null +++ b/_pages/dropdown.md @@ -0,0 +1,12 @@ +--- +layout: page +title: submenus +nav: true +dropdown: true +children: + - title: publications + permalink: /publications/ + - title: divider + - title: projects + permalink: /projects/ +--- \ No newline at end of file diff --git a/_sass/_base.scss b/_sass/_base.scss index 859d7530589e..0a2f17563f60 100644 --- a/_sass/_base.scss +++ b/_sass/_base.scss @@ -14,7 +14,7 @@ a, table.table a { color: var(--global-theme-color); text-decoration: underline; } - &:hover:after { + &:hover:after :not(.nav-item.dropdown) { width: 100%; } } @@ -95,6 +95,22 @@ blockquote { background-color: var(--global-bg-color); opacity: 0.95; } +.navbar .dropdown-menu { + background-color: var(--global-bg-color); + a:not(.active) { + color: var(--global-text-color); + } + a:hover { + color: var(--global-hover-color); + } +} +.dropdown-item { + color: var(--global-text-color); + &:hover { + color: var(--global-hover-color); + background-color: var(--global-bg-color); + } +} .navbar.navbar-light { a { &:hover {