cosmos-docusaurus-theme 2.0.1 → 2.0.2

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/CHANGELOG.md CHANGED
@@ -7,6 +7,30 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ---
9
9
 
10
+ ## [2.0.2] — 2026-03-11
11
+
12
+ ### Added
13
+
14
+ - **Dynamic version badge** — sidebar badge now reads version from `package.json` at
15
+ build time via `injectHtmlTags()` in `src/index.js`; no longer hardcoded in CSS.
16
+ Consumers upgrading the package will see the correct version without any manual edit.
17
+
18
+ ### Changed
19
+
20
+ - **Font weights** — Outfit loaded with 4 weights (`400;500;600;700`) instead of 6
21
+ (`300;400;500;600;700;800`) — `300` and `800` were unused, reducing Google Fonts payload
22
+ - **demo/package.json** — `cosmos-docusaurus-theme: "latest"` → `"^2"` to prevent
23
+ pulling an unexpected future major version at Docker build time
24
+ - **Dockerfile** — simplified: only `demo/` is copied (no longer needs the full project
25
+ tree since `file:..` dependency is replaced by `^2` from npm); proper layer caching
26
+ with `package.json` copied before source files
27
+ - **workflow_dispatch default** — `ref` input default updated from `v2.0.0` → `v2.0.2`
28
+
29
+ ### Removed
30
+
31
+ - Hardcoded `:root { --cosmos-version: "cosmos v1.2.6" }` from `theme.css`
32
+ (superseded by `injectHtmlTags()` injection)
33
+
10
34
  ## [2.0.1] — 2026-03-10
11
35
 
12
36
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosmos-docusaurus-theme",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "A clean, dark-first Docusaurus CSS theme based on TailAdmin design system with Outfit typography",
5
5
  "keywords": [
6
6
  "docusaurus",
package/src/css/theme.css CHANGED
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  /* ── Outfit + JetBrains Mono fonts ───────────────────────────────────────── */
20
- @import 'https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap';
20
+ @import 'https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap';
21
21
 
22
22
  /* ── Light mode ──────────────────────────────────────────────────────────── */
23
23
  :root {
@@ -1257,10 +1257,6 @@ details > :not(summary) {
1257
1257
  Converting it to flex-column + making the scrollable nav flex:1 means the
1258
1258
  ::after pseudo-element is a flex-child OUTSIDE the scroll area — always
1259
1259
  pinned to the bottom regardless of content height or scroll position. */
1260
- :root {
1261
- --cosmos-version: "cosmos v1.2.6";
1262
- }
1263
-
1264
1260
  /* Sidebar viewport — flex column so version badge is always pinned at the bottom.
1265
1261
  Targets the CSS-module class via attribute substring match (Docusaurus 3). */
1266
1262
  [class*="sidebarViewport"] {
package/src/index.js CHANGED
@@ -15,6 +15,7 @@
15
15
  'use strict';
16
16
 
17
17
  const path = require('path');
18
+ const { version } = require('../package.json');
18
19
 
19
20
  /**
20
21
  * @param {import('@docusaurus/types').LoadContext} _context
@@ -34,6 +35,23 @@ function cosmosDocusaurusTheme(_context, _options) {
34
35
  getClientModules() {
35
36
  return [path.resolve(__dirname, 'css/theme.css')];
36
37
  },
38
+
39
+ /**
40
+ * Inject the package version as a CSS custom property so the sidebar
41
+ * version badge stays in sync with package.json automatically.
42
+ *
43
+ * @returns {import('@docusaurus/types').HtmlTags}
44
+ */
45
+ injectHtmlTags() {
46
+ return {
47
+ headTags: [
48
+ {
49
+ tagName: 'style',
50
+ innerHTML: `:root { --cosmos-version: "cosmos v${version}"; }`,
51
+ },
52
+ ],
53
+ };
54
+ },
37
55
  };
38
56
  }
39
57