Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert top menu to Bootstrap's navbar component
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
- Loading branch information
1 parent
1155c29
commit ac8ecb7
Showing
11 changed files
with
147 additions
and
17 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
<div id="topmenucontainer" class="menucontainer"> | ||
<i class="scrollindicator scrollindicator--left"><a href="#" class="tab"></a></i> | ||
<div class="navigationbar"> | ||
<ul id="topmenu" class="resizable-menu"> | ||
{% for tab in tabs %} | ||
<li{{ tab.active ? ' class="active"' }}> | ||
<a href="{{ url(tab.route, url_params|merge(tab.args ?? [])) }}" class="tab{{ tab.active ? 'active' }}"> | ||
{{ get_icon(tab.icon, tab.text, false, true, 'TabsMode') }} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
<div class="clearfloat"></div> | ||
</ul> | ||
</div> | ||
<i class="scrollindicator scrollindicator--right"><a href="#" class="tab"></a></i> | ||
<nav class="navbar navbar-expand-lg navbar-light bg-light"> | ||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-label=" | ||
{%- trans 'Toggle navigation' %}" aria-controls="navbarNav" aria-expanded="false"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navbarNav"> | ||
<ul class="navbar-nav"> | ||
{% for tab in tabs %} | ||
<li class="nav-item{{ tab.active ? ' active' }}"> | ||
<a class="nav-link text-nowrap" href="{{ url(tab.route, url_params|merge(tab.args ?? [])) }}"> | ||
{{ get_icon(tab.icon, tab.text, false, true, 'TabsMode') }} | ||
{% if tab.active %} | ||
<span class="sr-only">{% trans %}(current){% notes %}Current page{% endtrans %}</span> | ||
{% endif %} | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
</nav> | ||
</div> |
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,24 @@ | ||
.navbar { | ||
background-color: $th-background; | ||
padding-#{$left}: 20px; | ||
padding-#{$right}: 20px; | ||
} | ||
|
||
.navbar-nav .icon { | ||
margin-#{$right}: 0.5em; | ||
vertical-align: -3px; | ||
} | ||
|
||
.navbar-nav .nav-item { | ||
padding: 8px 10px; | ||
|
||
&.active { | ||
background: #fff; | ||
} | ||
} | ||
|
||
.navbar-nav .nav-link { | ||
text-transform: uppercase; | ||
font-family: $font-family-extra-bold; | ||
font-weight: normal; | ||
} |
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,34 @@ | ||
.navbar-nav { | ||
font-weight: bold; | ||
} | ||
|
||
.navbar-nav .icon { | ||
vertical-align: middle; | ||
margin-#{$right}: 0.1em; | ||
} | ||
|
||
.navbar-nav .nav-item { | ||
border-bottom: 1pt solid black; | ||
|
||
&.active .nav-link { | ||
margin: 0; | ||
background-color: $body-bg; | ||
padding: 2px 4px; | ||
} | ||
} | ||
|
||
.navbar-nav .nav-link { | ||
margin: 2px 2px 0; | ||
padding: 2px 2px 0; | ||
background-color: $bg-one; | ||
border-color: $bg-two; | ||
border-style: solid; | ||
border-width: 1pt 1pt 0 1pt; | ||
border-radius: 0.4em 0.4em 0 0; | ||
|
||
&:hover { | ||
margin: 0; | ||
background-color: $body-bg; | ||
padding: 2px 4px; | ||
} | ||
} |
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,32 @@ | ||
.navbar.bg-light { | ||
background: linear-gradient(#fff, #dcdcdc); | ||
} | ||
|
||
.navbar-nav { | ||
font-weight: bold; | ||
} | ||
|
||
.navbar-nav .icon { | ||
margin-#{$right}: 0.5em; | ||
vertical-align: -3px; | ||
} | ||
|
||
.navbar-nav .nav-item { | ||
background: linear-gradient(#fff, #dcdcdc); | ||
border-#{$right}: 1px solid #fff; | ||
border-#{$left}: 1px solid #ccc; | ||
border-bottom: 1px solid #ccc; | ||
|
||
&:first-child { | ||
border-#{$left}: 0; | ||
} | ||
|
||
&:hover { | ||
background: linear-gradient(#fff, #e5e5e5); | ||
} | ||
|
||
&.active { | ||
background: #fff; | ||
border-bottom: 0; | ||
} | ||
} |
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