@sckyzo/cosmos-theme 0.0.1
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 +19 -0
- package/LICENSE +21 -0
- package/README.md +48 -0
- package/css/css-vars.css +52 -0
- package/css/fonts.css +13 -0
- package/css/tailwind-tokens.css +78 -0
- package/package.json +50 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@sckyzo/cosmos-theme` are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.0.1] - 2026-05-20
|
|
9
|
+
|
|
10
|
+
First test release.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Tailwind 4 theme (`css/tailwind-tokens.css`) — design tokens exposed as
|
|
15
|
+
`@theme` so consumer projects inherit the Cosmos scale, palette and radii.
|
|
16
|
+
- Universal CSS variables (`css/css-vars.css`) — light/dark mode surfaces
|
|
17
|
+
(`--color-bg-base`, `--color-text-base`, brand ramp, status colors).
|
|
18
|
+
- Font face declarations (`css/fonts.css`) — Outfit (display/body) and
|
|
19
|
+
JetBrains Mono (code), distributed via `@fontsource/*`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 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,48 @@
|
|
|
1
|
+
# @sckyzo/cosmos-theme
|
|
2
|
+
|
|
3
|
+
Cosmos design tokens — CSS only.
|
|
4
|
+
|
|
5
|
+
Provides three CSS files consumable by any framework:
|
|
6
|
+
|
|
7
|
+
| Import | Purpose |
|
|
8
|
+
| ------------------------------- | ---------------------------------------------------------------------- |
|
|
9
|
+
| `@sckyzo/cosmos-theme/tailwind` | Tailwind 4 `@theme` block (palette, fonts, shadows, brand colors) |
|
|
10
|
+
| `@sckyzo/cosmos-theme/vars` | Universal CSS custom properties (bg, text, border, accent + dark mode) |
|
|
11
|
+
| `@sckyzo/cosmos-theme/fonts` | `@fontsource` font imports (Outfit + JetBrains Mono) |
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### With Tailwind 4 (recommended for React apps)
|
|
16
|
+
|
|
17
|
+
```css
|
|
18
|
+
/* src/index.css */
|
|
19
|
+
@import '@sckyzo/cosmos-theme/fonts';
|
|
20
|
+
@import '@sckyzo/cosmos-theme/tailwind';
|
|
21
|
+
@import 'tailwindcss';
|
|
22
|
+
@import '@sckyzo/cosmos-theme/vars';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Without Tailwind (e.g. Docusaurus)
|
|
26
|
+
|
|
27
|
+
```css
|
|
28
|
+
@import '@sckyzo/cosmos-theme/fonts';
|
|
29
|
+
@import '@sckyzo/cosmos-theme/vars';
|
|
30
|
+
/* Then reference vars: var(--color-brand-500), var(--color-bg-base), etc. */
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Tokens
|
|
34
|
+
|
|
35
|
+
See [`css/tailwind-tokens.css`](css/tailwind-tokens.css) for the full source.
|
|
36
|
+
|
|
37
|
+
Categories:
|
|
38
|
+
|
|
39
|
+
- **Brand palette** : `--color-brand-25` to `--color-brand-950`
|
|
40
|
+
- **Semantic colors** : `--color-success-*`, `--color-error-*`, `--color-warn-*`
|
|
41
|
+
- **Status** : `--color-status-{ok,warn,crit,unknown}`
|
|
42
|
+
- **Typography** : `--font-sans` (Outfit), `--font-mono` (JetBrains Mono)
|
|
43
|
+
- **Shadows** : `--shadow-card`, `--shadow-card-hover`
|
|
44
|
+
- **Layout vars** (dark-mode aware): `--color-bg-{base,panel,elevated}`, `--color-text-{base,primary,secondary,muted}`, `--color-border`, `--color-accent`
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
MIT — see [LICENSE](../../LICENSE).
|
package/css/css-vars.css
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* Cosmos CSS variables — universal (work with or without Tailwind).
|
|
2
|
+
*
|
|
3
|
+
* Light mode is :root (default). Dark mode is .dark — applied by the
|
|
4
|
+
* consumer's theme switcher (ThemeContext, etc.) on the <html> element.
|
|
5
|
+
*
|
|
6
|
+
* Consumers reference these via var(--color-bg-base), var(--color-text-primary), etc.
|
|
7
|
+
* Tailwind 4 utilities (bg-accent-primary, etc.) are bridged via tailwind-tokens.css.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
:root {
|
|
11
|
+
/* ── Surfaces ──────────────────────────────────────────────────────────── */
|
|
12
|
+
--color-bg-base: #f9fafb;
|
|
13
|
+
--color-bg-panel: #fff;
|
|
14
|
+
--color-bg-elevated: #fff;
|
|
15
|
+
|
|
16
|
+
/* ── Borders ───────────────────────────────────────────────────────────── */
|
|
17
|
+
--color-border: #d0d5dd;
|
|
18
|
+
|
|
19
|
+
/* ── Text ──────────────────────────────────────────────────────────────── */
|
|
20
|
+
--color-text-base: #101828;
|
|
21
|
+
--color-text-primary: #101828;
|
|
22
|
+
--color-text-secondary: #667085;
|
|
23
|
+
--color-text-muted: #98a2b3;
|
|
24
|
+
|
|
25
|
+
/* ── Accent ────────────────────────────────────────────────────────────── */
|
|
26
|
+
--color-accent: #465fff;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.dark {
|
|
30
|
+
color-scheme: dark;
|
|
31
|
+
|
|
32
|
+
--color-bg-base: #0c111d;
|
|
33
|
+
--color-bg-panel: #1a2231;
|
|
34
|
+
--color-bg-elevated: #1d2939;
|
|
35
|
+
|
|
36
|
+
--color-border: #344054;
|
|
37
|
+
|
|
38
|
+
--color-text-base: #e4e7ec;
|
|
39
|
+
--color-text-primary: #fff;
|
|
40
|
+
--color-text-secondary: #98a2b3;
|
|
41
|
+
--color-text-muted: #667085;
|
|
42
|
+
|
|
43
|
+
--color-accent: #465fff;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Smooth theme switching transition — opt-in via .cosmos-bg-transition class
|
|
47
|
+
on the app shell (not body, to avoid transitioning every DOM element). */
|
|
48
|
+
.cosmos-bg-transition {
|
|
49
|
+
transition-property: color, background-color, border-color;
|
|
50
|
+
transition-duration: 500ms;
|
|
51
|
+
transition-timing-function: ease;
|
|
52
|
+
}
|
package/css/fonts.css
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* Cosmos fonts — self-hosted via @fontsource (no internet required at runtime).
|
|
2
|
+
Consumers must install @fontsource/outfit and @fontsource/jetbrains-mono as deps. */
|
|
3
|
+
|
|
4
|
+
@import '@fontsource/outfit/300.css';
|
|
5
|
+
@import '@fontsource/outfit/400.css';
|
|
6
|
+
@import '@fontsource/outfit/500.css';
|
|
7
|
+
@import '@fontsource/outfit/600.css';
|
|
8
|
+
@import '@fontsource/outfit/700.css';
|
|
9
|
+
@import '@fontsource/outfit/800.css';
|
|
10
|
+
|
|
11
|
+
@import '@fontsource/jetbrains-mono/400.css';
|
|
12
|
+
@import '@fontsource/jetbrains-mono/500.css';
|
|
13
|
+
@import '@fontsource/jetbrains-mono/700.css';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* Cosmos Tailwind 4 theme — @theme block (generates Tailwind utility classes).
|
|
2
|
+
*
|
|
3
|
+
* Usage:
|
|
4
|
+
* @import '@sckyzo/cosmos-theme/fonts';
|
|
5
|
+
* @import '@sckyzo/cosmos-theme/tailwind';
|
|
6
|
+
* @import 'tailwindcss';
|
|
7
|
+
* @import '@sckyzo/cosmos-theme/vars';
|
|
8
|
+
*
|
|
9
|
+
* The dark variant is class-based (.dark) — applied by the consumer's theme switcher.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/* Tailwind dark variant: respond to the .dark class set by the consumer's ThemeContext,
|
|
13
|
+
instead of (or in addition to) prefers-color-scheme. */
|
|
14
|
+
@custom-variant dark (&:is(.dark, .dark *));
|
|
15
|
+
|
|
16
|
+
@theme {
|
|
17
|
+
/* ── Typography ─────────────────────────────────────────────────────────── */
|
|
18
|
+
--font-sans: 'Outfit', system-ui, sans-serif;
|
|
19
|
+
--font-mono: 'JetBrains Mono', monospace;
|
|
20
|
+
|
|
21
|
+
/* ── Status colors — health indicators, badges, alerts ─────────────────── */
|
|
22
|
+
--color-status-ok: #10b981;
|
|
23
|
+
--color-status-warn: #f59e0b;
|
|
24
|
+
--color-status-crit: #ef4444;
|
|
25
|
+
--color-status-unknown: #6b7280;
|
|
26
|
+
|
|
27
|
+
/* ── Card shadows — work on both light and dark backgrounds ────────────── */
|
|
28
|
+
--shadow-card: 0 1px 3px rgb(0 0 0 / 40%), 0 1px 2px rgb(0 0 0 / 30%);
|
|
29
|
+
--shadow-card-hover: 0 10px 25px rgb(0 0 0 / 50%), 0 4px 6px rgb(0 0 0 / 20%);
|
|
30
|
+
|
|
31
|
+
/* ── TailAdmin elevation shadows (theme.shadow-{xs,sm,md,lg,xl}) ───────── */
|
|
32
|
+
--shadow-theme-xs: 0px 1px 2px 0px rgb(16 24 40 / 5%);
|
|
33
|
+
--shadow-theme-sm: 0px 1px 3px 0px rgb(16 24 40 / 10%), 0px 1px 2px 0px rgb(16 24 40 / 6%);
|
|
34
|
+
--shadow-theme-md: 0px 4px 8px -2px rgb(16 24 40 / 10%), 0px 2px 4px -2px rgb(16 24 40 / 6%);
|
|
35
|
+
--shadow-theme-lg: 0px 12px 16px -4px rgb(16 24 40 / 8%), 0px 4px 6px -2px rgb(16 24 40 / 3%);
|
|
36
|
+
--shadow-theme-xl: 0px 20px 24px -4px rgb(16 24 40 / 8%), 0px 8px 8px -4px rgb(16 24 40 / 3%);
|
|
37
|
+
--shadow-focus-ring: 0px 0px 0px 4px rgb(70 95 255 / 12%);
|
|
38
|
+
|
|
39
|
+
/* ── Brand palette (TailAdmin blue) ────────────────────────────────────── */
|
|
40
|
+
--color-brand-25: #f2f7ff;
|
|
41
|
+
--color-brand-50: #ecf3ff;
|
|
42
|
+
--color-brand-100: #dde9ff;
|
|
43
|
+
--color-brand-200: #c2d6ff;
|
|
44
|
+
--color-brand-300: #9cb9ff;
|
|
45
|
+
--color-brand-400: #7592ff;
|
|
46
|
+
--color-brand-500: #465fff;
|
|
47
|
+
--color-brand-600: #3641f5;
|
|
48
|
+
--color-brand-700: #2a31d8;
|
|
49
|
+
--color-brand-800: #252dae;
|
|
50
|
+
--color-brand-900: #262e89;
|
|
51
|
+
--color-brand-950: #161950;
|
|
52
|
+
|
|
53
|
+
/* Dark gray aligned with Tailwind gray-900 — keeps SectionCard bg matching body bg */
|
|
54
|
+
--color-gray-dark: #111827;
|
|
55
|
+
|
|
56
|
+
/* ── Semantic colors ───────────────────────────────────────────────────── */
|
|
57
|
+
--color-success-25: #f6fef9;
|
|
58
|
+
--color-success-50: #ecfdf3;
|
|
59
|
+
--color-success-100: #d1fadf;
|
|
60
|
+
--color-success-500: #12b76a;
|
|
61
|
+
--color-success-600: #039855;
|
|
62
|
+
|
|
63
|
+
--color-error-25: #fffbfa;
|
|
64
|
+
--color-error-50: #fef3f2;
|
|
65
|
+
--color-error-100: #fee4e2;
|
|
66
|
+
--color-error-500: #f04438;
|
|
67
|
+
--color-error-600: #d92d20;
|
|
68
|
+
|
|
69
|
+
--color-warning-25: #fffcf5;
|
|
70
|
+
--color-warning-50: #fffaeb;
|
|
71
|
+
--color-warning-100: #fef0c7;
|
|
72
|
+
--color-warning-500: #f79009;
|
|
73
|
+
--color-warning-600: #dc6803;
|
|
74
|
+
|
|
75
|
+
/* ── Bridges: aliases that pull values from CSS vars (defined in css-vars.css)
|
|
76
|
+
so utilities like bg-accent-primary stay in sync with theme switcher. */
|
|
77
|
+
--color-accent-primary: var(--color-accent);
|
|
78
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sckyzo/cosmos-theme",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Cosmos design tokens — Tailwind 4 theme + universal CSS variables (palette, fonts, dark mode)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "SckyzO",
|
|
7
|
+
"homepage": "https://github.com/SckyzO/cosmos/tree/main/packages/theme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/SckyzO/cosmos.git",
|
|
11
|
+
"directory": "packages/theme"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./css/tailwind-tokens.css",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./css/tailwind-tokens.css",
|
|
17
|
+
"./tailwind": "./css/tailwind-tokens.css",
|
|
18
|
+
"./vars": "./css/css-vars.css",
|
|
19
|
+
"./fonts": "./css/fonts.css",
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"css/",
|
|
24
|
+
"README.md",
|
|
25
|
+
"CHANGELOG.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@fontsource/jetbrains-mono": "^5.2.8",
|
|
30
|
+
"@fontsource/outfit": "^5.2.8"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"design-system",
|
|
37
|
+
"design-tokens",
|
|
38
|
+
"tailwindcss",
|
|
39
|
+
"tailwind-v4",
|
|
40
|
+
"css-variables",
|
|
41
|
+
"cosmos"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"lint": "echo 'CSS-only package, no JS lint needed'",
|
|
45
|
+
"lint:fix": "echo 'CSS-only package, no JS lint needed'",
|
|
46
|
+
"typecheck": "echo 'CSS-only package, no TS check needed'",
|
|
47
|
+
"test": "echo 'CSS-only package, no tests yet'",
|
|
48
|
+
"build": "echo 'CSS-only package, no build step needed'"
|
|
49
|
+
}
|
|
50
|
+
}
|