cosmos-docusaurus-theme 2.0.0 → 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,37 @@ 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
+
34
+ ## [2.0.1] — 2026-03-10
35
+
36
+ ### Fixed
37
+
38
+ - **Tables full-width**: `display:table; width:100%` on desktop (>996px),
39
+ `display:block; overflow-x:auto` on mobile — responsive, never breaks layout
40
+
10
41
  ## [2.0.0] — 2026-03-10
11
42
 
12
43
  ### Added — Native Docusaurus component coverage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosmos-docusaurus-theme",
3
- "version": "2.0.0",
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 {
@@ -397,6 +397,23 @@ code {
397
397
 
398
398
  /* ── Tables — direct overrides (CSS variables not reliably cascaded) ─────── */
399
399
 
400
+ /* Full-width tables on desktop; scrollable on mobile.
401
+ Infima forces display:block which caps width — we override for desktop,
402
+ and restore scrollable block on narrow viewports. */
403
+ .markdown table {
404
+ display: table !important;
405
+ width: 100% !important;
406
+ }
407
+
408
+ @media (width <= 996px) {
409
+ .markdown table {
410
+ display: block !important;
411
+ overflow-x: auto !important;
412
+ max-width: 100% !important;
413
+ width: max-content !important;
414
+ }
415
+ }
416
+
400
417
  /* Dark mode — Infima applies --ifm-table-head-background directly on th,
401
418
  so we must target th explicitly (higher specificity than thead). */
402
419
  [data-theme='dark'] table {
@@ -1240,10 +1257,6 @@ details > :not(summary) {
1240
1257
  Converting it to flex-column + making the scrollable nav flex:1 means the
1241
1258
  ::after pseudo-element is a flex-child OUTSIDE the scroll area — always
1242
1259
  pinned to the bottom regardless of content height or scroll position. */
1243
- :root {
1244
- --cosmos-version: "cosmos v1.2.6";
1245
- }
1246
-
1247
1260
  /* Sidebar viewport — flex column so version badge is always pinned at the bottom.
1248
1261
  Targets the CSS-module class via attribute substring match (Docusaurus 3). */
1249
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