saryants 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/LICENSE +21 -0
- package/README.md +85 -0
- package/dist/assets/entry-l0sNRNKZ.js +1 -0
- package/dist/saryants-theme.min.js +1 -0
- package/dist/saryants.min.css +1 -0
- package/dist/saryants.min.js +2 -0
- package/package.json +25 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 veertoooz
|
|
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,85 @@
|
|
|
1
|
+
# SaryanTS
|
|
2
|
+
|
|
3
|
+
Theme System (colors only) from **hue** and **chroma** (OKLCH). Part of **TamanyanLS · SaryanTS · ParajanovCS**.
|
|
4
|
+
|
|
5
|
+
- **TamanyanLS** — Layout System (depth-based sizes)
|
|
6
|
+
- **SaryanTS** — Theme System (colors)
|
|
7
|
+
- **ParajanovCS** — Component System (consumes both)
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
**CDN (single script)** — injects CSS + theme API:
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<!DOCTYPE html>
|
|
15
|
+
<html lang="en" data-theme="dark">
|
|
16
|
+
<head>
|
|
17
|
+
<meta charset="UTF-8" />
|
|
18
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
19
|
+
<script src="https://cdn.jsdelivr.net/npm/saryants@1.0.0/dist/saryants.min.js"></script>
|
|
20
|
+
</head>
|
|
21
|
+
<body>
|
|
22
|
+
<p style="color: var(--primary);">Themed text</p>
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Classic** — CSS + optional theme script:
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/saryants@1.0.0/dist/saryants.min.css" />
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/saryants@1.0.0/dist/saryants-theme.min.js"></script>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
- **Hue + chroma only**: Set `--hue` (0–360) and `--chroma` (0–0.4); all semantic colors are derived in CSS.
|
|
37
|
+
- **OKLCH**: Perceptually even colors.
|
|
38
|
+
- **Light / dark**: `data-theme="light"` or `data-theme="dark"` on `<html>` (default: dark).
|
|
39
|
+
- **Colors only**: No components, no spacing, no radius — use with TamanyanLS (sizes) and ParajanovCS (components).
|
|
40
|
+
|
|
41
|
+
## Semantic variables
|
|
42
|
+
|
|
43
|
+
SaryanTS exposes:
|
|
44
|
+
|
|
45
|
+
| Variable | Usage |
|
|
46
|
+
|---------|-------|
|
|
47
|
+
| `--bg`, `--bg-light`, `--bg-dark` | Backgrounds |
|
|
48
|
+
| `--text`, `--text-muted` | Text |
|
|
49
|
+
| `--primary`, `--secondary` | Actions |
|
|
50
|
+
| `--danger`, `--warning`, `--success`, `--info` | Semantic |
|
|
51
|
+
| `--border`, `--border-muted` | Borders |
|
|
52
|
+
| `--highlight` | Highlight |
|
|
53
|
+
| `--glass-bg`, `--glass-border` | Glass effects |
|
|
54
|
+
|
|
55
|
+
## JS API
|
|
56
|
+
|
|
57
|
+
If you load the theme script, `SaryanTSTheme` is available:
|
|
58
|
+
|
|
59
|
+
- `SaryanTSTheme.hue = 200` — set hue (0–360)
|
|
60
|
+
- `SaryanTSTheme.chroma = 0.2` — set chroma (0–1)
|
|
61
|
+
- `SaryanTSTheme.theme = 'light'` or `'dark'`
|
|
62
|
+
- `SaryanTSTheme.toggleTheme()` — switch light/dark
|
|
63
|
+
- `SaryanTSTheme.restore()` — restore from localStorage (called on load)
|
|
64
|
+
|
|
65
|
+
## Development
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm install
|
|
69
|
+
npm run build # Build CSS + theme JS
|
|
70
|
+
npm run dev # Build and serve demo
|
|
71
|
+
npm run preview # Preview production build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- `dist/saryants.min.css` — CSS bundle (tokens + themes)
|
|
75
|
+
- `dist/saryants-theme.min.js` — theme script
|
|
76
|
+
- `dist/saryants.min.js` — CDN bundle (CSS + theme)
|
|
77
|
+
|
|
78
|
+
## Browser support
|
|
79
|
+
|
|
80
|
+
- **OKLCH**: Chrome 111+, Safari 15.4+, Firefox 113+
|
|
81
|
+
- **CSS `mod()`**: Chrome 118+, Safari 17.2+, Firefox 128+
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
MIT.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){const r=document.documentElement,a="saryants-theme";function h(){try{const t=localStorage.getItem(a);return t?JSON.parse(t):null}catch{return null}}function o(t){try{localStorage.setItem(a,JSON.stringify(t))}catch{}}const m={get hue(){return parseFloat(r.style.getPropertyValue("--hue")||getComputedStyle(r).getPropertyValue("--hue")||"260")},set hue(t){const e=Math.max(0,Math.min(360,Number(t)));r.style.setProperty("--hue",String(e)),o({...h()||{},hue:e})},get chroma(){return parseFloat(r.style.getPropertyValue("--chroma")||getComputedStyle(r).getPropertyValue("--chroma")||"0.15")},set chroma(t){const e=Math.max(0,Math.min(1,Number(t)));r.style.setProperty("--chroma",String(e)),o({...h()||{},chroma:e})},get theme(){return r.getAttribute("data-theme")||"dark"},set theme(t){const e=t==="light"?"light":"dark";r.setAttribute("data-theme",e),o({...h()||{},theme:e})},toggleTheme(){return this.theme=this.theme==="light"?"dark":"light",this.theme},restore(){const t=h();t&&(typeof t.hue=="number"&&(this.hue=t.hue),typeof t.chroma=="number"&&(this.chroma=t.chroma),t.theme&&(this.theme=t.theme))}};m.restore(),window.SaryanTSTheme=m})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--hue: 260;--chroma: .15}:root{--chroma-bg: calc(var(--chroma) * .5);--chroma-text: min(var(--chroma), .1);--chroma-action: max(var(--chroma), .1);--chroma-alert: max(var(--chroma), .05);--hue-secondary: mod(calc(var(--hue) + 180), 360)}:root{--bg-dark: oklch(.1 var(--chroma-bg) var(--hue));--bg: oklch(.15 var(--chroma-bg) var(--hue));--bg-light: oklch(.2 var(--chroma-bg) var(--hue));--text: oklch(.96 var(--chroma-text) var(--hue));--text-muted: oklch(.76 var(--chroma-text) var(--hue));--highlight: oklch(.5 var(--chroma) var(--hue));--border: oklch(.4 var(--chroma) var(--hue));--border-muted: oklch(.3 var(--chroma) var(--hue));--primary: oklch(.76 var(--chroma-action) var(--hue));--secondary: oklch(.76 var(--chroma-action) var(--hue-secondary));--danger: oklch(.7 var(--chroma-alert) 30);--warning: oklch(.7 var(--chroma-alert) 100);--success: oklch(.7 var(--chroma-alert) 160);--info: oklch(.7 var(--chroma-alert) 260);--glass-bg: oklch(.2 var(--chroma-bg) var(--hue) / .65);--glass-border: oklch(.4 var(--chroma) var(--hue) / .5)}[data-theme=light]{--bg-dark: oklch(.92 var(--chroma-bg) var(--hue));--bg: oklch(.96 var(--chroma-bg) var(--hue));--bg-light: oklch(1 var(--chroma-bg) var(--hue));--text: oklch(.15 var(--chroma) var(--hue));--text-muted: oklch(.4 var(--chroma) var(--hue));--highlight: oklch(1 var(--chroma) var(--hue));--border: oklch(.6 var(--chroma) var(--hue));--border-muted: oklch(.7 var(--chroma) var(--hue));--primary: oklch(.4 var(--chroma-action) var(--hue));--secondary: oklch(.4 var(--chroma-action) var(--hue-secondary));--danger: oklch(.5 var(--chroma-alert) 30);--warning: oklch(.5 var(--chroma-alert) 100);--success: oklch(.5 var(--chroma-alert) 160);--info: oklch(.5 var(--chroma-alert) 260);--glass-bg: oklch(.98 .02 var(--hue) / .65);--glass-border: oklch(.7 var(--chroma) var(--hue) / .5)}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){var r=`:root{--hue: 260;--chroma: .15}:root{--chroma-bg: calc(var(--chroma) * .5);--chroma-text: min(var(--chroma), .1);--chroma-action: max(var(--chroma), .1);--chroma-alert: max(var(--chroma), .05);--hue-secondary: mod(calc(var(--hue) + 180), 360)}:root{--bg-dark: oklch(.1 var(--chroma-bg) var(--hue));--bg: oklch(.15 var(--chroma-bg) var(--hue));--bg-light: oklch(.2 var(--chroma-bg) var(--hue));--text: oklch(.96 var(--chroma-text) var(--hue));--text-muted: oklch(.76 var(--chroma-text) var(--hue));--highlight: oklch(.5 var(--chroma) var(--hue));--border: oklch(.4 var(--chroma) var(--hue));--border-muted: oklch(.3 var(--chroma) var(--hue));--primary: oklch(.76 var(--chroma-action) var(--hue));--secondary: oklch(.76 var(--chroma-action) var(--hue-secondary));--danger: oklch(.7 var(--chroma-alert) 30);--warning: oklch(.7 var(--chroma-alert) 100);--success: oklch(.7 var(--chroma-alert) 160);--info: oklch(.7 var(--chroma-alert) 260);--glass-bg: oklch(.2 var(--chroma-bg) var(--hue) / .65);--glass-border: oklch(.4 var(--chroma) var(--hue) / .5)}[data-theme=light]{--bg-dark: oklch(.92 var(--chroma-bg) var(--hue));--bg: oklch(.96 var(--chroma-bg) var(--hue));--bg-light: oklch(1 var(--chroma-bg) var(--hue));--text: oklch(.15 var(--chroma) var(--hue));--text-muted: oklch(.4 var(--chroma) var(--hue));--highlight: oklch(1 var(--chroma) var(--hue));--border: oklch(.6 var(--chroma) var(--hue));--border-muted: oklch(.7 var(--chroma) var(--hue));--primary: oklch(.4 var(--chroma-action) var(--hue));--secondary: oklch(.4 var(--chroma-action) var(--hue-secondary));--danger: oklch(.5 var(--chroma-alert) 30);--warning: oklch(.5 var(--chroma-alert) 100);--success: oklch(.5 var(--chroma-alert) 160);--info: oklch(.5 var(--chroma-alert) 260);--glass-bg: oklch(.98 .02 var(--hue) / .65);--glass-border: oklch(.7 var(--chroma) var(--hue) / .5)}
|
|
2
|
+
`,a=document.createElement("style");a.id="saryants-styles",a.textContent=r,document.head.appendChild(a)})();
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "saryants",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Theme System (colors) from hue and chroma (OKLCH)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "veertoooz",
|
|
8
|
+
"files": ["dist"],
|
|
9
|
+
"keywords": ["css", "theme", "oklch", "colors", "design-tokens", "saryan", "tamanyan"],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/veertoooz/SaryanTS"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"prepublishOnly": "npm run build",
|
|
16
|
+
"build": "vite build && node build-theme-js.mjs && node build-cdn-js.mjs",
|
|
17
|
+
"build:css": "vite build",
|
|
18
|
+
"dev": "npm run build && vite",
|
|
19
|
+
"preview": "vite preview"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"esbuild": "^0.24.0",
|
|
23
|
+
"vite": "^6.0.0"
|
|
24
|
+
}
|
|
25
|
+
}
|