From 4b98daa47f3511aa50d8dc46718b9ee9292dac2b Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Fri, 15 Aug 2014 14:57:16 -0400 Subject: [PATCH] Add .active class for topbar dropdown items Previously, the `.active` class was being overriden by the `.dropdown` selectors in the `.top-bar-section`, thus not allowing active dropdown items to be highlighted. This commit adds another pseudo-selector to ensure the `.active` dropdown items get the correct highlight colors. It also works in dropdowns within dropdowns within dropdowns. --- .../topbar/examples_topbar_default.html | 1 + doc/pages/components/topbar.html | 2 ++ scss/foundation/components/_top-bar.scss | 21 +++++++++++-------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/doc/includes/topbar/examples_topbar_default.html b/doc/includes/topbar/examples_topbar_default.html index e30c82a4d..882f4c8ec 100755 --- a/doc/includes/topbar/examples_topbar_default.html +++ b/doc/includes/topbar/examples_topbar_default.html @@ -15,6 +15,7 @@ Right Button Dropdown diff --git a/doc/pages/components/topbar.html b/doc/pages/components/topbar.html index 5ad2cb2f9..30771df51 100755 --- a/doc/pages/components/topbar.html +++ b/doc/pages/components/topbar.html @@ -91,6 +91,7 @@ The top bar is a pretty complex piece of magical UI goodness. We rely on many pr Right Button Dropdown @@ -101,6 +102,7 @@ The top bar is a pretty complex piece of magical UI goodness. We rely on many pr Right Dropdown diff --git a/scss/foundation/components/_top-bar.scss b/scss/foundation/components/_top-bar.scss index c55c7d2c9..41a788885 100755 --- a/scss/foundation/components/_top-bar.scss +++ b/scss/foundation/components/_top-bar.scss @@ -567,15 +567,18 @@ $topbar-arrows: true !default; //Set false to remove the triangle icon from the background: $topbar-dropdown-link-bg; } - &:not(.has-form) a:not(.button) { - color: $topbar-dropdown-link-color; - background: $topbar-dropdown-link-bg; - } - &:not(.has-form):hover > a:not(.button) { - color: $topbar-link-color-hover; - background-color: $topbar-link-bg-color-hover; - @if ($topbar-link-bg-hover) { - background: $topbar-link-bg-hover; + &:not(.has-form):not(.active) { + & > a:not(.button) { + color: $topbar-dropdown-link-color; + background: $topbar-dropdown-link-bg; + } + + &:hover > a:not(.button) { + color: $topbar-link-color-hover; + background-color: $topbar-link-bg-color-hover; + @if ($topbar-link-bg-hover) { + background: $topbar-link-bg-hover; + } } } -- 2.47.2