@vantagecompute/docusaurus-theme 0.4.4 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vantagecompute/docusaurus-theme",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "Shared Vantage Compute Docusaurus theme — design system, brand assets, and common theme overrides for all vantagecompute documentation sites.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.cjs",
@@ -45,6 +45,6 @@
45
45
  "documentation"
46
46
  ],
47
47
  "engines": {
48
- "node": ">=22.0"
48
+ "node": ">=24.0"
49
49
  }
50
50
  }
@@ -1881,11 +1881,39 @@ article {
1881
1881
  }
1882
1882
 
1883
1883
 
1884
- /* ── Navbar version badge ──────────────────────────────────────────── */
1885
- .navbar__brand-with-version {
1884
+ /* ── Navbar centered title + version badge ─────────────────────────── */
1885
+
1886
+ /* Anchor for the absolutely-centered title below. */
1887
+ .navbar__inner {
1888
+ position: relative;
1889
+ }
1890
+
1891
+ /* theme-classic renders the title inside the brand <a>, beside the logo.
1892
+ Hide it there and let Navbar/Logo re-render it centered, so the version
1893
+ badge can sit immediately to its right. The brand link stays reachable
1894
+ via the logo image's alt text. */
1895
+ .navbar__brand .navbar__title {
1896
+ display: none;
1897
+ }
1898
+
1899
+ .navbar__center-title {
1900
+ position: absolute;
1901
+ left: 50%;
1902
+ top: 50%;
1903
+ transform: translate(-50%, -50%);
1886
1904
  display: flex;
1887
- align-items: center;
1888
- gap: 0;
1905
+ align-items: baseline;
1906
+ gap: 6px;
1907
+ white-space: nowrap;
1908
+ z-index: 1;
1909
+ /* Never swallow clicks meant for the brand link or navbar items. */
1910
+ pointer-events: none;
1911
+ }
1912
+
1913
+ .navbar__center-title-text {
1914
+ font-weight: 600;
1915
+ font-size: 1.2rem;
1916
+ color: var(--vantage-navbar-text);
1889
1917
  }
1890
1918
 
1891
1919
  .navbar__version-badge {
@@ -1895,7 +1923,18 @@ article {
1895
1923
  color: var(--vantage-navbar-text);
1896
1924
  white-space: nowrap;
1897
1925
  letter-spacing: 0.01em;
1898
- padding-left: 6px;
1926
+ }
1927
+
1928
+ /* On narrow screens the centered title would collide with the hamburger
1929
+ and the right-hand items, so drop it and restore the in-brand title. */
1930
+ @media (max-width: 996px) {
1931
+ .navbar__center-title {
1932
+ display: none;
1933
+ }
1934
+
1935
+ .navbar__brand .navbar__title {
1936
+ display: revert;
1937
+ }
1899
1938
  }
1900
1939
 
1901
1940
  /* Chat sidebar - push layout (navbar excluded) */
@@ -7,18 +7,36 @@ import React from 'react';
7
7
  import Logo from '@theme-init/Navbar/Logo';
8
8
  import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
9
9
 
10
+ /**
11
+ * Brand logo on the left, plus a centered title with the project version
12
+ * immediately to its right.
13
+ *
14
+ * The title cannot just be centered in place: theme-classic renders it inside
15
+ * the brand <a>, beside the logo, so centering it would drag the logo along.
16
+ * Instead the in-brand title is hidden by CSS and re-rendered here as its own
17
+ * absolutely-centered element, which lets the version badge sit next to it.
18
+ */
10
19
  export default function LogoWrapper(props) {
11
20
  const {siteConfig} = useDocusaurusContext();
12
- const version = siteConfig.customFields?.projectVersion;
21
+
22
+ const raw = siteConfig.customFields?.projectVersion;
23
+ const version = raw
24
+ ? String(raw).startsWith('v')
25
+ ? String(raw)
26
+ : `v${raw}`
27
+ : null;
28
+
29
+ const title = siteConfig.themeConfig?.navbar?.title;
13
30
 
14
31
  return (
15
- <div className="navbar__brand-with-version">
32
+ <>
16
33
  <Logo {...props} />
17
- {version && (
18
- <span className="navbar__version-badge">
19
- {String(version).startsWith('v') ? version : `v${version}`}
20
- </span>
34
+ {(title || version) && (
35
+ <div className="navbar__center-title">
36
+ {title && <span className="navbar__center-title-text">{title}</span>}
37
+ {version && <span className="navbar__version-badge">{version}</span>}
38
+ </div>
21
39
  )}
22
- </div>
40
+ </>
23
41
  );
24
42
  }