Skip to content

Move version selector to menu bar #41

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

Merged
merged 5 commits into from
May 2, 2023
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
18 changes: 18 additions & 0 deletions src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,21 @@ body ::-webkit-scrollbar-thumb {
max-width: 1280px;
margin: 0 auto;
}

/** pseudo-tailwind classes */

.flex {
display: flex;
}

.flex-col {
flex-direction: column;
}

.m-0 {
margin: 0;
}

.justify-between {
justify-content: space-between;
}
2 changes: 1 addition & 1 deletion src/css/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ body {
transition: max-height 0.2s ease, padding 0.2s ease;
}

.navbar-sub .container {
.navbar-sub .navlinks {
flex-direction: column;
}

Expand Down
18 changes: 15 additions & 3 deletions src/css/page-versions.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,23 @@
}

.page-versions .version-menu-toggle {
color: inherit;
color: var(--color-white);
background: url(../img/chevron.svg) no-repeat;
background-position: right 0.5rem top 50%;
background-size: auto 0.75em;
border: none;
outline: none;
line-height: inherit;
padding: 0.5rem 1.5rem 0.5rem 0.5rem;
padding: 7px 1.5rem 7px 30px;
position: relative;
z-index: var(--z-index-page-version-menu);
z-index: var(--z-index-page-version-menu-button);
font-size: 16px;
opacity: 0.8;
}

.page-versions .version-menu-toggle:hover {
opacity: 1;
text-decoration: none;
}

.page-versions .version-menu {
Expand All @@ -34,18 +41,23 @@
top: 0;
right: 0;
white-space: nowrap;
z-index: var(--z-index-page-version-menu);
color: var(--color-white);
font-size: 16px;
}

.page-versions:not(.is-active) .version-menu {
display: none;
}

.page-versions .version {
color: var(--color-white);
display: block;
padding-top: 0.5rem;
}

.page-versions .version.is-current {
color: var(--color-white);
display: none;
}

Expand Down
5 changes: 3 additions & 2 deletions src/css/vars.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
--toolbar-border-color: var(--panel-border-color);
--toolbar-font-color: var(--color-jet-30);
--toolbar-muted-color: var(--color-gray-30);
--page-version-menu-background: var(--color-smoke-70);
--page-version-menu-background: var(--color-jet-70);
--page-version-missing-font-color: var(--color-gray-30);
/* admonitions */
--caution-color: #a0439c;
Expand Down Expand Up @@ -140,5 +140,6 @@
--z-index-nav: 1;
--z-index-toolbar: 2;
--z-index-page-version-menu: 3;
--z-index-navbar: 4;
--z-index-page-version-menu-button: 4;
--z-index-navbar: 5;
}
2 changes: 1 addition & 1 deletion src/img/chevron.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 35 additions & 22 deletions src/partials/header-content.hbs
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
<header class="header">
<nav class="navbar">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item" href="https://stackable.tech/en/">{{!--site.title--}}<img src="{{{uiRootPath}}}/img/stackable-logo.png"></a>
<a class="navbar-item documentation-link" href="{{{or site.homeUrl site.url}}}">Documentation</a>
{{#if env.SITE_SEARCH_PROVIDER}}
<div class="navbar-item search hide-for-print">
<div id="search-field" class="field">
<input id="search-input" type="text" placeholder="Search..."{{#if page.home}} autofocus{{/if}}>
<div class="navbar-brand">
<a class="navbar-item" href="https://stackable.tech/en/">{{!--site.title--}}<img src="{{{uiRootPath}}}/img/stackable-logo.png"></a>
<a class="navbar-item documentation-link" href="{{{or site.homeUrl site.url}}}">Documentation</a>
{{#if env.SITE_SEARCH_PROVIDER}}
<div class="navbar-item search hide-for-print">
<div id="search-field" class="field">
<input id="search-input" type="text" placeholder="Search..."{{#if page.home}} autofocus{{/if}}>
</div>
</div>
{{/if}}
<button class="navbar-burger" data-target="navbar-sub">
<span></span>
<span></span>
<span></span>
</button>
<a href="https://www.stackable.tech/en/contact/" class="button pull-right">Contact Us</a>
</div>
{{/if}}
<button class="navbar-burger" data-target="navbar-sub">
<span></span>
<span></span>
<span></span>
</button>
<a href="https://www.stackable.tech/en/contact/" class="button pull-right">Contact Us</a>
</div>
<div id="topbar-nav" class="navbar-menu">
</div>
</div>
</nav>
<nav id="navbar-sub" class="navbar-sub">
<div class="container">
</div>
</nav>
<nav id="navbar-sub" class="navbar-sub">
<div class="container justify-between">
<div class="navlinks flex m-0">
{{#> navbar }}
navbar.hbs partial not found - you're seeing failover content
<a class="navbar-sub-item" href="#">Home</a>
Expand All @@ -35,10 +36,22 @@
</div>
</div>
{{/navbar}}

<a class="arrow" href="javascript:document.querySelector('.navbar-sub').classList.toggle('open')">
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"></path></svg>
</a>
</div>
</nav>
</header>
{{#with @root.page.versions}}
<div class="page-versions">
<button class="version-menu-toggle" title="Show other versions of page">{{@root.page.componentVersion.displayVersion}}</button>
<div class="version-menu">
{{#each this}}
<a class="version
{{~#if (eq ./version @root.page.version)}} is-current{{/if~}}
{{~#if ./missing}} is-missing{{/if}}" href="{{{relativize ./url}}}">{{./displayVersion}}</a>
{{/each}}
</div>
</div>
{{/with}}
</div>
</nav>
</header>
12 changes: 0 additions & 12 deletions src/partials/nav-menu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
{{#with @root.page.componentVersion}}
<h3 class="title"><a href="{{{relativize ./url}}}">{{./title}}</a></h3>
{{/with}}
{{#with @root.page.versions}}
<div class="page-versions">
<button class="version-menu-toggle" title="Show other versions of page">{{@root.page.componentVersion.displayVersion}}</button>
<div class="version-menu">
{{#each this}}
<a class="version
{{~#if (eq ./version @root.page.version)}} is-current{{/if~}}
{{~#if ./missing}} is-missing{{/if}}" href="{{{relativize ./url}}}">{{./displayVersion}}</a>
{{/each}}
</div>
</div>
{{/with}}
</div>
{{> nav-tree navigation=this}}
</nav>
Expand Down