The dropdown-offset-x() mixin now takes a 3rd argument first_level (fixes #1182)

Usage Examples:

```sass
// default behavior, first-child margin is 0
@include dropdown-offset-x(5px, left);
@include dropdown-offset-x(5px, left, true);
@include dropdown-offset-x(5px, left, 0px);

// first-child rule for the margin will not render (like your PR)
@include dropdown-offset-x(5px, left, false);
@include dropdown-offset-x(5px, left, null);

// first-child rule is applied and with a custom margin just for it

// default behavior, first-child margin is 0
@include dropdown-offset-x(5px, left, 10px);
```
This commit is contained in:
Djamil Legato
2016-03-09 10:59:30 -08:00
parent f0de1d8608
commit 44422e4dc0
2 changed files with 28 additions and 23 deletions
+2
View File
@@ -2,6 +2,8 @@
## XX/XX/2016
1. [Common](#common)
2. [](#improved)
- The `dropdown-offset-x()` mixin now includes a 3rd option that allows to disable or customize the offsets for the first level dropdown child (fixes #1182, thanks @JoomFX)
3. [](#bugfix)
- Fixed menu item height difference between regular and parent menu items (#1183)
2. [Joomla](#joomla)
@@ -38,29 +38,32 @@
}
// Dropdown Side Offset
@mixin dropdown-offset-x($offset: 5px, $direction: left) {
.g-main-nav {
.g-standard {
.g-dropdown {
margin-#{$direction}: $offset;
&:after {
content: "";
position: absolute;
display: block;
top: 0;
left: -$offset;
right: -$offset;
bottom: 0;
border-left: $offset solid transparent;
border-right: $offset solid transparent;
z-index: -1;
}
}
> .g-dropdown {
margin-#{$direction}: 0;
}
}
}
@mixin dropdown-offset-x($offset: 5px, $direction: left, $first_level: true) {
.g-main-nav {
.g-standard {
.g-dropdown {
margin-#{$direction}: $offset;
&:after {
content: "";
position: absolute;
display: block;
top: 0;
left: -$offset;
right: -$offset;
bottom: 0;
border-left: $offset solid transparent;
border-right: $offset solid transparent;
z-index: -1;
}
}
@if ($first_level == true or type-of($first_level) == number) {
> .g-dropdown {
margin-#{$direction}: if(type-of($first_level) == bool, 0, $first_level);
}
}
}
}
}
// Dropdown expansion direction