// @type Length
$dropdownmenu-border-width: nth($dropdownmenu-border, 1);
-@mixin left-right-arrows() {
- a::after {
- float: $global-right;
- margin-top: 3px;
- margin-#{$global-left}: 10px;
+@mixin left-right-arrows {
+ > a::after {
+ right: 14px;
+ margin-top: -3px;
}
&.opens-left > a::after {
top: 100%;
}
}
+
> li.opens-right {
> .is-dropdown-submenu {
right: auto;
top: 100%;
}
}
+
@if $dropdownmenu-arrows {
> li.is-dropdown-submenu-parent > a {
padding-#{$global-right}: 1.5rem;
> li.is-dropdown-submenu-parent > a::after {
@include css-triangle(5px, $dropdownmenu-arrow-color, down);
- position: absolute;
- top: rem-calc(2px) + rem-calc(get-side($menu-item-padding, top));
- #{$global-right}: 5px;
+ right: 5px;
+ margin-top: -2px;
}
}
-
- } @else if $dir == vertical {
+ }
+ @else if $dir == vertical {
> li {
.is-dropdown-submenu {
top: 0;
}
+
&.opens-left {
.is-dropdown-submenu {
left: auto;
right: 100%;
}
}
+
&.opens-right {
.is-dropdown-submenu {
right: auto;
left: 100%;
}
}
+
@if $dropdownmenu-arrows {
- @include left-right-arrows();
+ @include left-right-arrows;
}
}
- } @else {
+ }
+ @else {
@warn 'The direction used for dropdown-menu-direction() must be horizontal or vertical.';
}
}
@mixin foundation-dropdown-menu {
.dropdown.menu {
+ @include dropdown-menu-direction(horizontal);
+
a {
@include disable-mouse-outline;
}
display: none;
}
- @include dropdown-menu-direction(horizontal);
-
&.vertical {
@include dropdown-menu-direction(vertical);
}
.is-dropdown-submenu-parent {
position: relative;
+ a::after {
+ position: absolute;
+ top: 50%;
+ right: 5px;
+ margin-top: -2px;
+ }
+
&.opens-inner .is-dropdown-submenu {
top: 100%;
}
}
.is-dropdown-submenu, .top-bar .is-dropdown-submenu {
-
display: none;
position: absolute;
top: 0;
.is-dropdown-submenu-parent {
@if $dropdownmenu-arrows {
- @include left-right-arrows()
+ @include left-right-arrows;
}
}
+
@if (type-of($dropdownmenu-border-width) == 'number') {
.is-dropdown-submenu {
margin-top: (-$dropdownmenu-border-width);
width: 100%;
}
-
// [TODO] Cut back specificity
// scss-lint:disable SelectorDepth
&:not(.js-dropdown-nohover) > .is-dropdown-submenu-parent:hover > &,