From: Brett Mason Date: Sat, 12 Dec 2015 11:37:49 +0000 (+0000) Subject: Solves dropdown menu alignment if border is used X-Git-Tag: v6.1.0~35^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7514%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Solves dropdown menu alignment if border is used Solves dropdown menu alignment if a border is used. Also changed a few missing spaces and renamed a comment whilst I was at it! Fixes [#7169](https://github.com/zurb/foundation-sites/issues/7169). Thanks to @imranomari for the base code. --- diff --git a/scss/components/_dropdown-menu.scss b/scss/components/_dropdown-menu.scss index d920408fe..02d078c35 100644 --- a/scss/components/_dropdown-menu.scss +++ b/scss/components/_dropdown-menu.scss @@ -18,10 +18,15 @@ $dropdownmenu-min-width: 200px !default; /// @type Color $dropdownmenu-background: $white !default; -/// Border for dropdown panes. +/// Border for dropdown sub-menus. /// @type List $dropdownmenu-border: 1px solid $medium-gray !default; +// Border width for dropdown sub-menus. +// Used to adjust top margin of a sub-menu if a border is used. +// @type Length +$dropdownmenu-border-width: nth($dropdownmenu-border, 1); + @mixin foundation-dropdown-menu { .dropdown.menu { a { @@ -58,11 +63,11 @@ $dropdownmenu-border: 1px solid $medium-gray !default; } } - &.is-left-arrow.opens-inner .submenu{ + &.is-left-arrow.opens-inner .submenu { right: 0; left: auto; } - &.is-right-arrow.opens-inner .submenu{ + &.is-right-arrow.opens-inner .submenu { left: 0; right: auto; } @@ -85,6 +90,10 @@ $dropdownmenu-border: 1px solid $medium-gray !default; background: $dropdownmenu-background; border: $dropdownmenu-border; + @if (type_of($dropdownmenu-border-width) == 'number') { + margin-top: (-$dropdownmenu-border-width); + } + > li { width: 100%; }