Skip to content

Commit 3930e90

Browse files
committed
Use bootstrap class only that support RTL to style the navbar.
Previously navbar used ml-md-auto class which does not support RTL and also absolute position for the logo which does not automatically support switching to RTL. This commit adapt the navbar styling to automatically support RTL direction Signed-off-by: Mohammed Boukhalfa <[email protected]>
1 parent 8bcd930 commit 3930e90

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

assets/scss/_custom.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ body.td-404 main .error-details {
130130
transition: 0.3s;
131131

132132
.navbar-brand {
133-
position: absolute;
133+
134134
width: 45px;
135135
height: 44px;
136136
background-repeat: no-repeat;

layouts/partials/navbar.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{{ $cover := .HasShortcode "blocks/cover" }}
2-
<nav class="js-navbar-scroll navbar navbar-expand navbar-dark {{ if $cover}} td-navbar-cover {{ end }} flex-column flex-md-row td-navbar" data-auto-burger="primary">
3-
<a class="navbar-brand img-fluid" href="{{ .Site.Home.RelPermalink }}"></a>
4-
<div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar">
2+
<nav class="js-navbar-scroll navbar navbar-expand navbar-dark {{ if $cover}} td-navbar-cover {{ end }} justify-content-center td-navbar" data-auto-burger="primary">
3+
<a class="navbar-brand img-fluid d-flex " href="{{ .Site.Home.RelPermalink }}"></a>
4+
<div class="td-navbar-nav-scroll w-100" id="main_navbar">
55

6-
<ul class="navbar-nav mt-2 mt-lg-0">
6+
<ul class="navbar-nav ml-auto w-100 justify-content-end" >
77
{{ $p := . }}
88
{{ $sections := slice "docs" "blog" "training" "partners" "community" "case-studies" }}
99
{{ range $sections }}
1010
{{ with site.GetPage "section" . }}
11-
<li class="nav-item mr-2 mb-lg-0">
11+
<li class="nav-item">
1212
{{ $active := eq .Section $.Section }}
1313
<a class="nav-link{{if $active }} active{{end}}" href="{{ .RelPermalink }}" >{{ .Title }}</a>
1414
</li>
1515
{{ end }}
1616
{{ end }}
1717
{{ if .Site.Params.versions }}
18-
<li class="nav-item mr-n3 mr-lg-0 dropdown">
18+
<li class="nav-item dropdown">
1919
{{ partial "navbar-version-selector.html" . }}
2020
</li>
2121
{{ end }}
2222
{{ if (gt (len .Site.Home.Translations) 0) }}
23-
<li class="nav-item mr-n4 mr-lg-0 dropdown">
23+
<li class="nav-item dropdown">
2424
{{ partial "navbar-lang-selector.html" . }}
2525
</li>
2626
{{ end }}

0 commit comments

Comments
 (0)