Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: tweak active docs nav item border color #1077

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion assets/main/scss/docs/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}

.docs-nav-title-icon {
margin-left: -1.5rem;
margin-left: -.5rem;
}

.docs-sidebar {
Expand All @@ -50,3 +50,7 @@
}
}
}

.docs-nav-active-item {
margin-left: -.58rem;
}
13 changes: 10 additions & 3 deletions layouts/partials/docs/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,28 @@
{{- $active = true -}}
{{- end -}}
<li class="mb-2" tabindex="-1">
<div class="py-1 d-flex justify-content-between align-items-center ms-3{{ if $active }} text-primary{{ end }}">
<div class="py-1 d-flex justify-content-between align-items-center{{ if $active }} text-primary{{ end }}">
<a class="docs-nav-link d-flex align-items-center" href="{{ .RelPermalink }}">{{- template "nav-title" . -}}</a>
<a class="btn-toggle ms-1{{ if and (not $active) (not $expand) }} collapsed{{ end }}" role="button" data-bs-toggle="collapse"
data-bs-target="#{{ $sectionId }}" aria-expanded="{{ if or $active $expand }}true{{ else }}false{{ end }}" aria-controls="{{ $sectionId }}">
<i class="btn-toggle-icon fas fa-chevron-down ms-auto" data-fa-transform="rotate-270"></i>
</a>
</div>
<div class="docs-nav-subnavs border-start mt-2 collapse {{ if or $active $expand}} show{{ end }}{{ if $active }} border-primary{{ end }}" id="{{ $sectionId }}">
<div class="docs-nav-subnavs border-start mt-2 collapse {{ if or $active $expand }} show{{ end }}" id="{{ $sectionId }}">
<div class="btn-toggle-nav fw-normal ms-2{{ cond (default true site.Params.docs.nav.reduceFontSize) ` small` `` }}">
{{ template "walk-nav" (dict "section" . "page" $page) }}
</div>
</div>
</li>
{{- else -}}
<li class="mb-2 py-1 ms-3{{ if eq .RelPermalink $page.RelPermalink }} text-primary{{ end }}" tabindex="-1">
{{- $class := "mb-2 py-1" }}
{{- if eq .RelPermalink $page.RelPermalink }}
{{- $class = printf "%s text-primary" $class }}
{{- if ne $section.FirstSection $section }}
{{- $class = printf "%s border-2 border-start border-primary ps-2 docs-nav-active-item" $class }}
{{- end }}
{{- end }}
<li class="{{ $class }}" tabindex="-1">
<a class="docs-nav-link d-flex align-items-center" href="{{ .RelPermalink }}"{{ if .Params.redirect }} target="_blank"{{ end }}>
{{- template "nav-title" . -}}
{{- if .Params.redirect -}}
Expand Down
Loading