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(top-app-bar): align the brand and logo to center on small screen #790

Merged
merged 3 commits into from
Nov 16, 2022
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
2 changes: 1 addition & 1 deletion exampleSite/layouts/partials/hooks/docs/nav-begin.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="mb-3 pe-3">
<div class="mb-3 pe-lg-3">
<select class="form-select" aria-label="Docs Versions" onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);">
<option value="" selected>v1</option>
<option value="https://hbs.razonyang.com/v0/">v0</option>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/docs/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h5 class="offcanvas-title" id="offcanvasDocsNavLabel">Browse docs</h5>
{{- define "walk-nav" -}}
{{- $section := .section -}}
{{- $page := .page -}}
<ul class="list-unstyled mb-2 w-100{{ if eq $section $page.FirstSection }} pe-3{{ end }}">
<ul class="list-unstyled mb-2 w-100{{ if eq $section $page.FirstSection }} pe-lg-3{{ end }}">
{{- $expand := default false .page.Site.Params.docs.nav.expand -}}
{{- $pages := sort (where $section.Pages "Params.navWeight" ">" 0) "Params.navWeight" "desc" -}}
{{- $pages = union $pages (sort $section.Pages "Title") -}}
Expand Down
7 changes: 4 additions & 3 deletions layouts/partials/header/brand.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{{- $logo := (default "images/logo.webp" .Site.Params.logo) }}
<a class="navbar-brand d-flex align-items-center flex-grow-1 flex-lg-grow-0 text-lg-start{{ if eq .Type "docs" }} text-center{{ end }} ms-2 ms-lg-0 mx-auto me-lg-2{{ if .IsHome }} active{{ end }}" href="{{ "" | absLangURL }}">
<a class="navbar-brand d-flex align-items-center flex-grow-1 flex-lg-grow-0 justify-content-lg-start{{ if eq .Type "docs" }} justify-content-center{{ end }} ms-2 ms-lg-0 mx-auto me-lg-2{{ if .IsHome }} active{{ end }}"
href="{{ "" | absLangURL }}">
{{- if $logo }}
{{ partial "helpers/image" (dict "filename" $logo "alt" "Logo" "class" "logo" "resources" .Resources) }}
{{ partialCached "helpers/image" (dict "filename" $logo "alt" "Logo" "class" "logo" "resources" .Resources) }}
{{- end }}
{{- with .Site.Params.brand }}{{ . }}{{ else }}{{ $.Site.Title }}{{ end }}
</a>
</a>
6 changes: 3 additions & 3 deletions layouts/partials/header/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<nav class="top-app-bar shadow navbar navbar-expand-lg{{ if $.Site.Params.fixedHeader }} fixed-top{{ end }}">
<div class="{{- partialCached "functions/container-class" . .FirstSection -}}">
{{- if eq .Type "docs" }}
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasDocsNav"
<button class="navbar-toggler border-0" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasDocsNav"
aria-controls="offcanvasDocsCatalog" aria-expanded="false" aria-label="Toggle docs navigation">
<i class="fas fa-bars"></i>
</button>
{{- end }}
{{- partialCached "header/brand" . }}
<button class="navbar-toggler order-5" type="button" data-bs-toggle="offcanvas" data-bs-target="#navbarMenus"
{{- partial "header/brand" . }}
<button class="navbar-toggler order-5 border-0" type="button" data-bs-toggle="offcanvas" data-bs-target="#navbarMenus"
aria-controls="navbarMenus" aria-expanded="false" aria-label="Toggle navigation">
<i class="fas fa-ellipsis-h"></i>
</button>
Expand Down