Update docs top bar links to icons (#2189)

This commit is contained in:
Leendert de Borst
2026-06-18 23:03:40 +02:00
committed by Leendert de Borst
parent bb72774458
commit 6e96fefbec
5 changed files with 89 additions and 2 deletions

View File

@@ -244,11 +244,22 @@ const config: Config = {
href: 'https://aliasvault.net',
label: 'Website',
position: 'right',
className: 'navbar__icon-link navbar__icon-link--website',
'aria-label': 'AliasVault website',
},
{
href: 'https://discord.gg/DsaXMTEtpF',
label: 'Discord',
position: 'right',
className: 'navbar__icon-link navbar__icon-link--discord',
'aria-label': 'AliasVault Discord',
},
{
href: 'https://github.com/aliasvault/aliasvault',
label: 'GitHub',
position: 'right',
className: 'navbar__icon-link navbar__icon-link--github',
'aria-label': 'AliasVault GitHub repository',
},
],
},
@@ -286,7 +297,7 @@ const config: Config = {
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} AliasVault. Built with Docusaurus.`,
copyright: `Copyright © ${new Date().getFullYear()} AliasVault.`,
},
prism: {
theme: prismThemes.github,

View File

@@ -120,6 +120,78 @@ html[data-theme='dark'] {
margin-right: 0.25rem;
}
/* Website / Discord / GitHub render as icons in the top bar instead of text.
* Each modifier class supplies the glyph via the --av-icon mask; the icon is
* tinted with the navbar link color so it tracks light/dark mode and hover.
* Scoped to `.navbar__link` (the desktop bar) — in the mobile slide-in menu
* these are `.menu__link` and keep their text label (with the icon alongside,
* see below). */
.navbar__link.navbar__icon-link {
font-size: 0; /* hide the text label; the glyph comes from ::before */
display: flex;
align-items: center;
}
.navbar__link.navbar__icon-link::before {
content: '';
display: inline-block;
width: 1.4rem;
height: 1.4rem;
background-color: var(--ifm-navbar-link-color);
-webkit-mask: var(--av-icon) center / contain no-repeat;
mask: var(--av-icon) center / contain no-repeat;
transition: background-color 0.15s ease;
}
.navbar__link.navbar__icon-link:hover::before {
background-color: var(--ifm-navbar-link-hover-color);
}
/* Docusaurus appends an external-link arrow to off-site links; drop it on the
* icon-only desktop links. */
.navbar__link.navbar__icon-link svg {
display: none;
}
/* In the mobile slide-in menu the links keep their text label, with the same
* glyph shown alongside it. */
.menu__link.navbar__icon-link::before {
content: '';
display: inline-block;
width: 1.2rem;
height: 1.2rem;
margin-right: 0.55rem;
vertical-align: -0.2rem;
background-color: currentColor;
-webkit-mask: var(--av-icon) center / contain no-repeat;
mask: var(--av-icon) center / contain no-repeat;
}
.navbar__icon-link--website {
--av-icon: url('/assets/img/icons/website.svg');
}
.navbar__icon-link--discord {
--av-icon: url('/assets/img/icons/discord.svg');
}
.navbar__icon-link--github {
--av-icon: url('/assets/img/icons/github.svg');
}
/* Collapse to the hamburger menu earlier than Infima's default 996px. With six
* navbar items (four left + Website/GitHub) plus the wide wordmark logo, the
* inline links get cramped between ~996px and ~1150px — "Self-host Install"
* wraps onto two lines. Switching to the mobile slide-in menu sooner avoids
* that. The slide-in sidebar is always rendered and toggled by JS, so only the
* toggle/inline-item visibility needs raising. */
@media (max-width: 1150px) {
.navbar__toggle {
display: inherit;
}
.navbar__item {
display: none;
}
}
/* --------------------------------------------------------------- Sidebar -- */
/* Sidebar sits on a slightly raised surface so it reads as a distinct panel
@@ -364,8 +436,9 @@ html[class*='docs-doc-id-installation/index'] .theme-doc-markdown {
}
.av-install-card:hover .button--secondary.button--outline {
background-color: var(--ifm-color-primary);
border-color: var(--ifm-color-primary);
color: var(--ifm-color-primary);
color: #fff;
}
/* ------------------------------------------------ Clickable action cards -- */

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000"><path d="M20.317 4.369a19.79 19.79 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.211.375-.444.864-.608 1.249a18.27 18.27 0 0 0-5.487 0 12.6 12.6 0 0 0-.617-1.25.077.077 0 0 0-.079-.036A19.74 19.74 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.2 14.2 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10 10 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01q.18.149.373.292a.077.077 0 0 1-.006.127 12.3 12.3 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.06.06 0 0 0-.031-.03M8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418m7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.605-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23A11.5 11.5 0 0 1 12 5.803c1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.91 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222 0 1.606-.014 2.898-.014 3.293 0 .322.218.694.825.576C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>

After

Width:  |  Height:  |  Size: 831 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M3 12h18"/><path d="M12 3a14.5 14.5 0 0 1 0 18 14.5 14.5 0 0 1 0-18"/></svg>

After

Width:  |  Height:  |  Size: 267 B