-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from contao-themes-net/feature/megamenu
Feature/megamenu
- Loading branch information
Showing
8 changed files
with
185 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/Resources/contao/templates/modules/mod_navigation_nature_megamenu.html5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
<!-- indexer::stop --> | ||
<nav class="<?= $this->class ?> navbar megamenu block"<?= $this->cssID ?><?php if ($this->style): ?> style="<?= $this->style ?>"<?php endif; ?> itemscope itemtype="http://schema.org/SiteNavigationElement" aria-label="main navigation"> | ||
|
||
<div class="navbar-brand"> | ||
<a class="navbar-item" href="{{env::path}}"> | ||
{{theme::content::NATURE01/01}} | ||
</a> | ||
|
||
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" data-target="navbarMain"> | ||
<span aria-hidden="true"></span> | ||
<span aria-hidden="true"></span> | ||
<span aria-hidden="true"></span> | ||
</a> | ||
</div> | ||
|
||
<?php if ($this->headline): ?> | ||
<<?= $this->hl ?>><?= $this->headline ?></<?= $this->hl ?>> | ||
<?php endif; ?> | ||
|
||
<a href="<?= $this->request ?>#<?= $this->skipId ?>" class="invisible"><?= $this->skipNavigation ?></a> | ||
|
||
<div id="navbarMain" class="navbar-menu is-primary"> | ||
<?= $this->items ?> | ||
</div> | ||
|
||
<a id="<?= $this->skipId ?>" class="invisible"> </a> | ||
|
||
</nav> | ||
|
||
<!-- indexer::continue --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
@media screen and (min-width: $navbar-breakpoint) { | ||
.home .megamenu .navbar-item .navbar-dropdown.level_2 { | ||
background: $megamenu-background-color-home; | ||
} | ||
|
||
.megamenu { | ||
&.mod_navigation.navbar .navbar-dropdown.open { | ||
display: flex !important; | ||
} | ||
|
||
.navbar-item { | ||
position: static; | ||
height: 100%; | ||
|
||
&:hover .navbar-dropdown.level_2 { | ||
display: flex; | ||
} | ||
|
||
.navbar-dropdown.level_2 { | ||
position: absolute; | ||
left: inherit; | ||
right: $megamenu-right; | ||
max-width: calc(100% - #{$megamenu-right}); | ||
width: $megamenu-width; | ||
flex-wrap: wrap; | ||
padding: $megamenu-padding; | ||
background: $megamenu-background-color; | ||
|
||
@media (max-width: calc(#{$megamenu-width} + #{$megamenu-right})) { | ||
max-width: 100%; | ||
right: inherit; | ||
left: 0; | ||
} | ||
|
||
> .navbar-item, > .navbar-link { | ||
width: calc(#{$megamenu-item-width} - 40px); | ||
margin: 0 20px 20px; | ||
} | ||
|
||
> a.navbar-item, > div.navbar-item > a { | ||
font-size: 1.2em; | ||
font-weight: 700; | ||
color: $megamenu-link-lvl2-color; | ||
padding: 5px 20px; | ||
white-space: normal; | ||
border-bottom: 2px solid $megamenu-border-color; | ||
margin-bottom: 10px; | ||
font-family: $family-heading; | ||
|
||
&:hover, &.active { | ||
color: $megamenu-link-lvl2-color-hover; | ||
} | ||
} | ||
|
||
.navbar-link:after, .toggle-more, .toggle-less { | ||
display: none; | ||
} | ||
} | ||
|
||
.navbar-dropdown.level_3 { | ||
background: none; | ||
padding: 0; | ||
min-width: 100%; | ||
|
||
> a.navbar-item, > div.navbar-item > a { | ||
color: $megamenu-link-lvl3-color; | ||
padding: 5px 20px; | ||
white-space: normal; | ||
|
||
&:hover, &.active { | ||
color: $megamenu-link-lvl3-color-hover; | ||
} | ||
} | ||
} | ||
} | ||
|
||
&.mod_navigation.navbar .has-dropdown .has-dropdown .level_3, &.mod_navigation.navbar .has-dropdown .has-dropdown .level_4 { | ||
position: relative; | ||
top: inherit; | ||
left: inherit; | ||
display: block !important; | ||
} | ||
|
||
.navbar-dropdown.level_2 { | ||
.navbar-item { | ||
display: block; | ||
} | ||
} | ||
|
||
.navbar-dropdown { | ||
box-shadow: none; | ||
} | ||
|
||
&.navbar .navbar-start { | ||
padding-top: 0; | ||
padding-bottom: 0; | ||
} | ||
} | ||
} |