cosmos-docusaurus-theme 1.0.0
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 +26 -0
- package/LICENSE +21 -0
- package/README.md +136 -0
- package/package.json +48 -0
- package/src/css/theme.css +447 -0
- package/src/index.js +40 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
|
+
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [1.0.0] — 2024-03-09
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Initial release of `cosmos-docusaurus-theme`
|
|
15
|
+
- CSS-only theme based on TailAdmin design system
|
|
16
|
+
- Proper Docusaurus theme plugin via `getClientModules()` — use with `themes: ['cosmos-docusaurus-theme']`
|
|
17
|
+
- Backwards-compatible CSS import via `cosmos-docusaurus-theme/css/theme.css`
|
|
18
|
+
- Light and dark mode support (`[data-theme='dark']`)
|
|
19
|
+
- Outfit + JetBrains Mono typography loaded from Google Fonts
|
|
20
|
+
- Indigo brand palette (`#465fff`) mapped to Infima CSS variables
|
|
21
|
+
- Styled: navbar, sidebar, code blocks, admonitions, tables, pagination, footer, scrollbar
|
|
22
|
+
- Optional utility classes: `.method-get/post/put/delete/patch`, `.status-ok/warn/crit/unknown`
|
|
23
|
+
- Demo site deployed to GitHub Pages
|
|
24
|
+
- CI workflow: stylelint + npm audit + demo build
|
|
25
|
+
- Publish workflow: npm publish + GitHub Pages deploy on `v*` tags
|
|
26
|
+
- Dependabot for npm and GitHub Actions
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 SckyzO
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# cosmos-docusaurus-theme
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/cosmos-docusaurus-theme)
|
|
4
|
+
[](https://www.npmjs.com/package/cosmos-docusaurus-theme)
|
|
5
|
+
[](https://github.com/SckyzO/cosmos-docusaurus-theme/actions/workflows/ci.yml)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
A clean, dark-first Docusaurus theme based on the [TailAdmin](https://tailadmin.com) design system.
|
|
9
|
+
|
|
10
|
+
- **CSS-only** — no swizzled components, no JavaScript
|
|
11
|
+
- **Dark mode first-class** (default), full light mode support
|
|
12
|
+
- **Outfit** + **JetBrains Mono** typography
|
|
13
|
+
- **Indigo** brand palette (`#465fff`) mapped to Infima variables
|
|
14
|
+
- Compatible with **Docusaurus 3+**
|
|
15
|
+
|
|
16
|
+
**[Live Demo](https://sckyzo.github.io/cosmos-docusaurus-theme)**
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Screenshots
|
|
21
|
+
|
|
22
|
+
> Light and dark mode — navbar, sidebar, code blocks, admonitions
|
|
23
|
+
|
|
24
|
+
<!-- Screenshots are added after the first gh-pages deployment -->
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install cosmos-docusaurus-theme
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
Register it as a Docusaurus theme plugin in `docusaurus.config.js`:
|
|
37
|
+
|
|
38
|
+
```js title="docusaurus.config.js"
|
|
39
|
+
export default {
|
|
40
|
+
themes: ['cosmos-docusaurus-theme'],
|
|
41
|
+
|
|
42
|
+
themeConfig: {
|
|
43
|
+
colorMode: {
|
|
44
|
+
defaultMode: 'dark',
|
|
45
|
+
respectPrefersColorScheme: true,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The CSS is injected automatically. No `customCss` entry needed.
|
|
52
|
+
|
|
53
|
+
### Alternative — direct CSS import
|
|
54
|
+
|
|
55
|
+
If you prefer to control injection manually:
|
|
56
|
+
|
|
57
|
+
```js title="docusaurus.config.js"
|
|
58
|
+
export default {
|
|
59
|
+
presets: [
|
|
60
|
+
['classic', {
|
|
61
|
+
theme: {
|
|
62
|
+
customCss: [require.resolve('cosmos-docusaurus-theme/css/theme.css')],
|
|
63
|
+
},
|
|
64
|
+
}],
|
|
65
|
+
],
|
|
66
|
+
};
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Customization
|
|
72
|
+
|
|
73
|
+
Override any Infima variable after the theme import:
|
|
74
|
+
|
|
75
|
+
```css title="src/css/custom.css"
|
|
76
|
+
/* Change brand color */
|
|
77
|
+
:root {
|
|
78
|
+
--ifm-color-primary: #e11d48;
|
|
79
|
+
--ifm-color-primary-dark: #be123c;
|
|
80
|
+
--ifm-color-primary-darker: #9f1239;
|
|
81
|
+
--ifm-color-primary-darkest: #881337;
|
|
82
|
+
--ifm-color-primary-light: #fb7185;
|
|
83
|
+
--ifm-color-primary-lighter: #fda4af;
|
|
84
|
+
--ifm-color-primary-lightest:#ffe4e6;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Change font */
|
|
88
|
+
:root {
|
|
89
|
+
--ifm-font-family-base: 'Inter', system-ui, sans-serif;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Adjust sidebar width */
|
|
93
|
+
:root {
|
|
94
|
+
--ifm-sidebar-width: 320px;
|
|
95
|
+
--doc-sidebar-width: 320px;
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Utility classes
|
|
102
|
+
|
|
103
|
+
The theme ships optional utility classes for API and operational docs:
|
|
104
|
+
|
|
105
|
+
| Class | Usage |
|
|
106
|
+
|------------------|----------------------------------------|
|
|
107
|
+
| `.method-get` | HTTP GET label (green, monospace) |
|
|
108
|
+
| `.method-post` | HTTP POST label (blue, monospace) |
|
|
109
|
+
| `.method-put` | HTTP PUT label (orange, monospace) |
|
|
110
|
+
| `.method-delete` | HTTP DELETE label (red, monospace) |
|
|
111
|
+
| `.method-patch` | HTTP PATCH label (purple, monospace) |
|
|
112
|
+
| `.status-ok` | OK state (green, bold) |
|
|
113
|
+
| `.status-warn` | WARN state (orange, bold) |
|
|
114
|
+
| `.status-crit` | CRIT state (red, bold) |
|
|
115
|
+
| `.status-unknown`| UNKNOWN state (gray, bold) |
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Development
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Install root dependencies (stylelint)
|
|
123
|
+
npm install
|
|
124
|
+
|
|
125
|
+
# Lint the CSS
|
|
126
|
+
npm run lint
|
|
127
|
+
|
|
128
|
+
# Start the demo site locally
|
|
129
|
+
cd demo && npm install && npm run start
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
[MIT](LICENSE) — © SckyzO
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cosmos-docusaurus-theme",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A clean, dark-first Docusaurus CSS theme based on TailAdmin design system with Outfit typography",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"docusaurus",
|
|
7
|
+
"docusaurus-theme",
|
|
8
|
+
"theme",
|
|
9
|
+
"tailadmin",
|
|
10
|
+
"css",
|
|
11
|
+
"dark-mode",
|
|
12
|
+
"outfit",
|
|
13
|
+
"infima"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://sckyzo.github.io/cosmos-docusaurus-theme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/SckyzO/cosmos-docusaurus-theme/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/SckyzO/cosmos-docusaurus-theme.git"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"author": "SckyzO",
|
|
25
|
+
"main": "src/index.js",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": "./src/index.js",
|
|
28
|
+
"./css/theme.css": "./src/css/theme.css"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"src/",
|
|
32
|
+
"LICENSE",
|
|
33
|
+
"README.md",
|
|
34
|
+
"CHANGELOG.md"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"lint:css": "stylelint \"src/css/**/*.css\"",
|
|
38
|
+
"lint": "npm run lint:css",
|
|
39
|
+
"audit:check": "npm audit --audit-level=moderate"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"stylelint": "^17.4.0",
|
|
43
|
+
"stylelint-config-standard": "^40.0.0"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cosmos Docusaurus Theme
|
|
3
|
+
*
|
|
4
|
+
* A clean, dark-first Docusaurus CSS theme based on the TailAdmin design system.
|
|
5
|
+
* Colors, typography, shadows and spacing extracted from TailAdmin's design tokens.
|
|
6
|
+
* Mapped to Docusaurus Infima CSS variables for seamless integration.
|
|
7
|
+
*
|
|
8
|
+
* Brand: #465fff (indigo)
|
|
9
|
+
* Font: Outfit (same as TailAdmin) + JetBrains Mono for code
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* In docusaurus.config.js → theme.customCss:
|
|
13
|
+
* require.resolve('cosmos-docusaurus-theme')
|
|
14
|
+
*
|
|
15
|
+
* @see https://github.com/SckyzO/cosmos-docusaurus-theme
|
|
16
|
+
* @license MIT
|
|
17
|
+
*/
|
|
18
|
+
|
|
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';
|
|
21
|
+
|
|
22
|
+
/* ── Light mode ──────────────────────────────────────────────────────────── */
|
|
23
|
+
:root {
|
|
24
|
+
/* Primary brand colors — TailAdmin brand-* palette */
|
|
25
|
+
--ifm-color-primary: #465fff; /* brand-500 */
|
|
26
|
+
--ifm-color-primary-dark: #3641f5; /* brand-600 */
|
|
27
|
+
--ifm-color-primary-darker: #2a31d8; /* brand-700 */
|
|
28
|
+
--ifm-color-primary-darkest: #252dae; /* brand-800 */
|
|
29
|
+
--ifm-color-primary-light: #7592ff; /* brand-400 */
|
|
30
|
+
--ifm-color-primary-lighter: #9cb9ff; /* brand-300 */
|
|
31
|
+
--ifm-color-primary-lightest:#dde9ff; /* brand-100 */
|
|
32
|
+
|
|
33
|
+
/* Typography — TailAdmin uses Outfit as the primary typeface */
|
|
34
|
+
--ifm-font-family-base: 'Outfit', system-ui, -apple-system, sans-serif;
|
|
35
|
+
--ifm-font-family-monospace: 'JetBrains Mono', 'Fira Code', monospace;
|
|
36
|
+
--ifm-font-size-base: 16.5px;
|
|
37
|
+
--ifm-font-weight-bold: 600;
|
|
38
|
+
--ifm-line-height-base: 1.7;
|
|
39
|
+
--ifm-code-font-size: 93%;
|
|
40
|
+
--ifm-h1-font-size: 2.2rem;
|
|
41
|
+
--ifm-h2-font-size: 1.6rem;
|
|
42
|
+
--ifm-h3-font-size: 1.25rem;
|
|
43
|
+
|
|
44
|
+
/* Background — TailAdmin gray-50 / white */
|
|
45
|
+
--ifm-background-color: #f9fafb; /* gray-50 */
|
|
46
|
+
--ifm-background-surface-color: #fff; /* white */
|
|
47
|
+
|
|
48
|
+
/* Text — TailAdmin gray-900 / gray-500 */
|
|
49
|
+
--ifm-font-color-base: #101828; /* gray-900 */
|
|
50
|
+
--ifm-font-color-secondary: #667085; /* gray-500 */
|
|
51
|
+
|
|
52
|
+
/* Navbar — 72px height to match TailAdmin header proportions */
|
|
53
|
+
--ifm-navbar-height: 72px;
|
|
54
|
+
--ifm-navbar-background-color: #fff;
|
|
55
|
+
--ifm-navbar-shadow: 0px 1px 3px 0px rgb(16,24,40,0.10), 0px 1px 2px 0px rgb(16,24,40,0.06);
|
|
56
|
+
--ifm-navbar-link-color: #344054; /* gray-700 */
|
|
57
|
+
--ifm-navbar-link-hover-color: #465fff; /* brand-500 */
|
|
58
|
+
--ifm-navbar-link-active-color: #465fff;
|
|
59
|
+
|
|
60
|
+
/* Sidebar */
|
|
61
|
+
--ifm-sidebar-width: 280px;
|
|
62
|
+
--doc-sidebar-width: 280px;
|
|
63
|
+
--ifm-sidebar-padding: 16px;
|
|
64
|
+
--docusaurus-collapse-button-bg-hover-color: #f2f4f7; /* gray-100 */
|
|
65
|
+
|
|
66
|
+
/* Links */
|
|
67
|
+
--ifm-link-color: #465fff;
|
|
68
|
+
--ifm-link-hover-color: #3641f5;
|
|
69
|
+
|
|
70
|
+
/* Borders — TailAdmin gray-200 */
|
|
71
|
+
--ifm-toc-border-color: #e4e7ec;
|
|
72
|
+
--ifm-hr-border-color: #e4e7ec;
|
|
73
|
+
--ifm-color-emphasis-300: #e4e7ec;
|
|
74
|
+
--ifm-color-emphasis-600: #667085;
|
|
75
|
+
|
|
76
|
+
/* Code blocks */
|
|
77
|
+
--ifm-code-background: #f2f4f7; /* gray-100 */
|
|
78
|
+
--prism-background-color:#1d2939; /* gray-800 — TailAdmin dark surface */
|
|
79
|
+
--docusaurus-highlighted-code-line-bg: rgb(70, 95, 255, 0.1);
|
|
80
|
+
|
|
81
|
+
/* Shadows — from TailAdmin elevation tokens */
|
|
82
|
+
--ifm-global-shadow-md: 0px 4px 8px -2px rgb(16,24,40,0.10), 0px 2px 4px -2px rgb(16,24,40,0.06);
|
|
83
|
+
--ifm-global-shadow-lw: 0px 1px 2px 0px rgb(16,24,40,0.05);
|
|
84
|
+
|
|
85
|
+
/* Menu item spacing */
|
|
86
|
+
--ifm-menu-link-padding-horizontal: 12px;
|
|
87
|
+
--ifm-menu-link-padding-vertical: 8px;
|
|
88
|
+
|
|
89
|
+
/* Table */
|
|
90
|
+
--ifm-table-border-color: #e4e7ec;
|
|
91
|
+
--ifm-table-head-background: #f9fafb;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* ── Dark mode ───────────────────────────────────────────────────────────── */
|
|
95
|
+
[data-theme='dark'] {
|
|
96
|
+
/* Primary — lighter variant for readability on dark backgrounds */
|
|
97
|
+
--ifm-color-primary: #7592ff; /* brand-400 */
|
|
98
|
+
--ifm-color-primary-dark: #465fff; /* brand-500 */
|
|
99
|
+
--ifm-color-primary-darker: #3641f5; /* brand-600 */
|
|
100
|
+
--ifm-color-primary-darkest: #2a31d8; /* brand-700 */
|
|
101
|
+
--ifm-color-primary-light: #9cb9ff; /* brand-300 */
|
|
102
|
+
--ifm-color-primary-lighter: #c2d6ff; /* brand-200 */
|
|
103
|
+
--ifm-color-primary-lightest:#dde9ff; /* brand-100 */
|
|
104
|
+
--docusaurus-highlighted-code-line-bg: rgb(117, 146, 255, 0.15);
|
|
105
|
+
|
|
106
|
+
/* Background — TailAdmin dark surfaces */
|
|
107
|
+
--ifm-background-color: #0f1117; /* deeper than gray-dark for body */
|
|
108
|
+
--ifm-background-surface-color: #1a2231; /* gray-dark — card/sidebar surfaces */
|
|
109
|
+
--ifm-navbar-background-color: #1a2231;
|
|
110
|
+
--ifm-footer-background-color: #0c111d; /* gray-950 */
|
|
111
|
+
|
|
112
|
+
/* Text */
|
|
113
|
+
--ifm-font-color-base: #e4e7ec; /* light body text */
|
|
114
|
+
--ifm-font-color-secondary: #98a2b3; /* muted / secondary text */
|
|
115
|
+
|
|
116
|
+
/* Borders — TailAdmin gray-700 */
|
|
117
|
+
--ifm-toc-border-color: #344054;
|
|
118
|
+
--ifm-hr-border-color: #344054;
|
|
119
|
+
--ifm-color-emphasis-300: #344054;
|
|
120
|
+
--ifm-color-emphasis-600: #98a2b3;
|
|
121
|
+
--ifm-table-border-color: #344054;
|
|
122
|
+
--ifm-table-head-background: #1d2939;
|
|
123
|
+
|
|
124
|
+
/* Links */
|
|
125
|
+
--ifm-link-color: #7592ff;
|
|
126
|
+
--ifm-link-hover-color: #9cb9ff;
|
|
127
|
+
|
|
128
|
+
/* Navbar */
|
|
129
|
+
--ifm-navbar-link-color: #d0d5dd; /* gray-300 */
|
|
130
|
+
--ifm-navbar-link-hover-color: #7592ff;
|
|
131
|
+
--ifm-navbar-link-active-color:#7592ff;
|
|
132
|
+
--ifm-navbar-shadow: 0px 1px 0px 0px #344054;
|
|
133
|
+
|
|
134
|
+
/* Code */
|
|
135
|
+
--ifm-code-background: #1d2939;
|
|
136
|
+
|
|
137
|
+
/* Sidebar collapse button */
|
|
138
|
+
--docusaurus-collapse-button-bg-hover-color: rgb(255,255,255,0.05);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* ── Global body ─────────────────────────────────────────────────────────── */
|
|
142
|
+
html {
|
|
143
|
+
/* Enable Outfit OpenType features for better number and letter rendering */
|
|
144
|
+
font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
|
|
145
|
+
-webkit-font-smoothing: antialiased;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* ── Navbar ──────────────────────────────────────────────────────────────── */
|
|
149
|
+
.navbar {
|
|
150
|
+
border-bottom: 1px solid var(--ifm-toc-border-color);
|
|
151
|
+
box-shadow: none;
|
|
152
|
+
padding: 0 24px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.navbar__brand {
|
|
156
|
+
font-weight: 700;
|
|
157
|
+
font-size: 1.125rem;
|
|
158
|
+
letter-spacing: -0.3px;
|
|
159
|
+
gap: 10px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.navbar__logo {
|
|
163
|
+
height: 28px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.navbar__link {
|
|
167
|
+
font-weight: 500;
|
|
168
|
+
font-size: 0.875rem;
|
|
169
|
+
border-radius: 6px;
|
|
170
|
+
padding: 6px 10px;
|
|
171
|
+
transition: background 0.15s, color 0.15s;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.navbar__link:hover {
|
|
175
|
+
background: rgb(70, 95, 255, 0.08);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
[data-theme='dark'] .navbar {
|
|
179
|
+
border-bottom-color: #344054;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* ── Sidebar ─────────────────────────────────────────────────────────────── */
|
|
183
|
+
.theme-doc-sidebar-container {
|
|
184
|
+
border-right: 1px solid var(--ifm-toc-border-color) !important;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
[data-theme='dark'] .theme-doc-sidebar-container {
|
|
188
|
+
border-right-color: #344054 !important;
|
|
189
|
+
background: #1a2231;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.theme-doc-sidebar-menu {
|
|
193
|
+
padding: 12px 8px;
|
|
194
|
+
font-size: 0.875rem;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* Sidebar nav items — rounded, smooth transitions */
|
|
198
|
+
.menu__list-item--collapsed .menu__link,
|
|
199
|
+
.menu__list-item .menu__link {
|
|
200
|
+
border-radius: 8px;
|
|
201
|
+
font-weight: 500;
|
|
202
|
+
transition: background 0.12s, color 0.12s;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Active sidebar link — TailAdmin: bg-brand-50 + text-brand-500 */
|
|
206
|
+
.menu__link--active,
|
|
207
|
+
.menu__link--active:hover {
|
|
208
|
+
background: #ecf3ff; /* brand-50 */
|
|
209
|
+
color: #465fff; /* brand-500 */
|
|
210
|
+
font-weight: 600;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
[data-theme='dark'] .menu__link--active,
|
|
214
|
+
[data-theme='dark'] .menu__link--active:hover {
|
|
215
|
+
background: rgb(70, 95, 255, 0.12);
|
|
216
|
+
color: #7592ff; /* brand-400 */
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* Sidebar collapsible category */
|
|
220
|
+
.menu__list-item-collapsible {
|
|
221
|
+
border-radius: 8px;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.menu__list-item-collapsible:hover {
|
|
225
|
+
background: #f2f4f7; /* gray-100 */
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
[data-theme='dark'] .menu__list-item-collapsible:hover {
|
|
229
|
+
background: rgb(255,255,255,0.05);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/* Sidebar section separator — uppercase label style from TailAdmin */
|
|
233
|
+
.sidebar_menu_section_title {
|
|
234
|
+
font-size: 0.6875rem;
|
|
235
|
+
font-weight: 700;
|
|
236
|
+
letter-spacing: 0.08em;
|
|
237
|
+
text-transform: uppercase;
|
|
238
|
+
color: #98a2b3; /* gray-400 */
|
|
239
|
+
padding: 12px 12px 4px;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* ── Code blocks ─────────────────────────────────────────────────────────── */
|
|
243
|
+
.prism-code {
|
|
244
|
+
border-radius: 10px;
|
|
245
|
+
font-size: 0.8625rem;
|
|
246
|
+
line-height: 1.65;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/* Inline code — subtle bordered style */
|
|
250
|
+
code {
|
|
251
|
+
border-radius: 5px;
|
|
252
|
+
padding: 2px 6px;
|
|
253
|
+
font-size: 0.875em;
|
|
254
|
+
border: 1px solid var(--ifm-toc-border-color);
|
|
255
|
+
background: var(--ifm-code-background);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* ── Content headings ─────────────────────────────────────────────────────── */
|
|
259
|
+
.markdown h1,
|
|
260
|
+
.markdown h2,
|
|
261
|
+
.markdown h3,
|
|
262
|
+
.markdown h4 {
|
|
263
|
+
font-weight: 700;
|
|
264
|
+
letter-spacing: -0.3px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.markdown h1 { font-size: 2.2rem; }
|
|
268
|
+
|
|
269
|
+
.markdown h2 {
|
|
270
|
+
font-size: 1.6rem;
|
|
271
|
+
padding-bottom: 8px;
|
|
272
|
+
border-bottom: 1px solid var(--ifm-toc-border-color);
|
|
273
|
+
margin-top: 2.5rem;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/* ── Table of contents (right panel) ─────────────────────────────────────── */
|
|
277
|
+
.table-of-contents__link {
|
|
278
|
+
font-size: 0.8125rem;
|
|
279
|
+
color: var(--ifm-font-color-secondary);
|
|
280
|
+
transition: color 0.12s;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.table-of-contents__link:hover,
|
|
284
|
+
.table-of-contents__link--active {
|
|
285
|
+
color: var(--ifm-color-primary);
|
|
286
|
+
font-weight: 500;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/* ── Admonitions — TailAdmin semantic color palette ──────────────────────── */
|
|
290
|
+
.alert--info {
|
|
291
|
+
border-left-color: #465fff;
|
|
292
|
+
background: rgb(70, 95, 255, 0.05);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.alert--success {
|
|
296
|
+
border-left-color: #12b76a;
|
|
297
|
+
background: rgb(18, 183, 106, 0.05);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.alert--warning {
|
|
301
|
+
border-left-color: #f79009;
|
|
302
|
+
background: rgb(247, 144, 9, 0.05);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.alert--danger {
|
|
306
|
+
border-left-color: #f04438;
|
|
307
|
+
background: rgb(240, 68, 56, 0.05);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
[data-theme='dark'] .alert--info {
|
|
311
|
+
background: rgb(70, 95, 255, 0.08);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
[data-theme='dark'] .alert--success {
|
|
315
|
+
background: rgb(18, 183, 106, 0.08);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
[data-theme='dark'] .alert--warning {
|
|
319
|
+
background: rgb(247, 144, 9, 0.08);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
[data-theme='dark'] .alert--danger {
|
|
323
|
+
background: rgb(240, 68, 56, 0.08);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/* ── Badges ───────────────────────────────────────────────────────────────── */
|
|
327
|
+
.badge--success {
|
|
328
|
+
background: #12b76a;
|
|
329
|
+
color: white;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.badge--warning {
|
|
333
|
+
background: #f79009;
|
|
334
|
+
color: white;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.badge--danger {
|
|
338
|
+
background: #f04438;
|
|
339
|
+
color: white;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* ── Footer ───────────────────────────────────────────────────────────────── */
|
|
343
|
+
.footer {
|
|
344
|
+
border-top: 1px solid var(--ifm-toc-border-color);
|
|
345
|
+
font-size: 0.875rem;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
[data-theme='dark'] .footer {
|
|
349
|
+
border-top-color: #344054;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/* ── Pagination nav ───────────────────────────────────────────────────────── */
|
|
353
|
+
.pagination-nav__link {
|
|
354
|
+
border-color: var(--ifm-toc-border-color);
|
|
355
|
+
border-radius: 10px;
|
|
356
|
+
transition: border-color 0.15s, box-shadow 0.15s;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.pagination-nav__link:hover {
|
|
360
|
+
border-color: var(--ifm-color-primary);
|
|
361
|
+
box-shadow: 0 0 0 3px rgb(70, 95, 255, 0.12);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/* ── Scrollbar — thin, TailAdmin style ───────────────────────────────────── */
|
|
365
|
+
::-webkit-scrollbar {
|
|
366
|
+
width: 5px;
|
|
367
|
+
height: 5px;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
::-webkit-scrollbar-track {
|
|
371
|
+
background: transparent;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
::-webkit-scrollbar-thumb {
|
|
375
|
+
background: #d0d5dd;
|
|
376
|
+
border-radius: 10px;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
::-webkit-scrollbar-thumb:hover {
|
|
380
|
+
background: #98a2b3;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
[data-theme='dark'] ::-webkit-scrollbar-thumb {
|
|
384
|
+
background: #344054;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
[data-theme='dark'] ::-webkit-scrollbar-thumb:hover {
|
|
388
|
+
background: #475467;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/* =============================================================================
|
|
392
|
+
OPTIONAL UTILITY CLASSES
|
|
393
|
+
The following classes are not required for the theme to work.
|
|
394
|
+
Include them when building API reference or status documentation.
|
|
395
|
+
============================================================================= */
|
|
396
|
+
|
|
397
|
+
/* HTTP method badges — useful for API reference pages */
|
|
398
|
+
.method-get {
|
|
399
|
+
color: #12b76a;
|
|
400
|
+
font-weight: 700;
|
|
401
|
+
font-family: var(--ifm-font-family-monospace);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.method-post {
|
|
405
|
+
color: #465fff;
|
|
406
|
+
font-weight: 700;
|
|
407
|
+
font-family: var(--ifm-font-family-monospace);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
.method-put {
|
|
411
|
+
color: #f79009;
|
|
412
|
+
font-weight: 700;
|
|
413
|
+
font-family: var(--ifm-font-family-monospace);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.method-delete {
|
|
417
|
+
color: #f04438;
|
|
418
|
+
font-weight: 700;
|
|
419
|
+
font-family: var(--ifm-font-family-monospace);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.method-patch {
|
|
423
|
+
color: #9b59b6;
|
|
424
|
+
font-weight: 700;
|
|
425
|
+
font-family: var(--ifm-font-family-monospace);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/* Status / health state labels — useful for operational docs */
|
|
429
|
+
.status-ok {
|
|
430
|
+
color: #12b76a;
|
|
431
|
+
font-weight: 600;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.status-warn {
|
|
435
|
+
color: #f79009;
|
|
436
|
+
font-weight: 600;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
.status-crit {
|
|
440
|
+
color: #f04438;
|
|
441
|
+
font-weight: 600;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.status-unknown {
|
|
445
|
+
color: #667085;
|
|
446
|
+
font-weight: 600;
|
|
447
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cosmos-docusaurus-theme
|
|
3
|
+
*
|
|
4
|
+
* A Docusaurus theme plugin that injects the Cosmos CSS theme.
|
|
5
|
+
* Implemented as a proper Docusaurus theme via getClientModules() so that
|
|
6
|
+
* consumers can use the standard `themes` array in their config:
|
|
7
|
+
*
|
|
8
|
+
* themes: ['cosmos-docusaurus-theme']
|
|
9
|
+
*
|
|
10
|
+
* No component swizzling — CSS-only override of Infima variables.
|
|
11
|
+
*
|
|
12
|
+
* @see https://docusaurus.io/docs/api/plugin-methods/lifecycle-apis#getClientModules
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
'use strict';
|
|
16
|
+
|
|
17
|
+
const path = require('path');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @param {import('@docusaurus/types').LoadContext} _context
|
|
21
|
+
* @param {object} _options
|
|
22
|
+
* @returns {import('@docusaurus/types').Plugin}
|
|
23
|
+
*/
|
|
24
|
+
function cosmosDocusaurusTheme(_context, _options) {
|
|
25
|
+
return {
|
|
26
|
+
name: 'cosmos-docusaurus-theme',
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Return the CSS file as a client module so Docusaurus injects it
|
|
30
|
+
* into the page bundle automatically.
|
|
31
|
+
*
|
|
32
|
+
* @returns {string[]}
|
|
33
|
+
*/
|
|
34
|
+
getClientModules() {
|
|
35
|
+
return [path.resolve(__dirname, 'css/theme.css')];
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = cosmosDocusaurusTheme;
|