mirror of
https://github.com/gantry/gantry5.git
synced 2026-08-19 01:15:04 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user