@lessonkit/themes 0.9.2 → 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/README.md +17 -34
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @lessonkit/themes
|
|
2
2
|
|
|
3
|
-
[](https://github.com/eddiethedean/lessonkit/actions/workflows/ci.yml)
|
|
4
|
-
[](https://lessonkit.readthedocs.io/en/latest/)
|
|
5
3
|
[](https://www.npmjs.com/package/@lessonkit/themes)
|
|
4
|
+
[](https://lessonkit.readthedocs.io/en/latest/reference/theming.html)
|
|
6
5
|
[](https://github.com/eddiethedean/lessonkit/blob/main/LICENSE)
|
|
7
6
|
|
|
8
|
-
Design tokens and
|
|
9
|
-
|
|
10
|
-
**Docs:** [Theming reference](https://lessonkit.readthedocs.io/en/latest/reference/theming.html) · [Theming & accessibility guide](https://lessonkit.readthedocs.io/en/latest/guides/react-developers/theming-and-accessibility.html)
|
|
7
|
+
Design tokens, presets, and CSS variable utilities for LessonKit.
|
|
11
8
|
|
|
12
9
|
## Install
|
|
13
10
|
|
|
@@ -15,41 +12,27 @@ Design tokens and theme utilities for LessonKit.
|
|
|
15
12
|
npm install @lessonkit/themes
|
|
16
13
|
```
|
|
17
14
|
|
|
18
|
-
##
|
|
19
|
-
|
|
20
|
-
### Types
|
|
15
|
+
## Usage
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- `PartialLessonkitThemeV1` — partial overrides for merge / `ThemeProvider`
|
|
17
|
+
```typescript
|
|
18
|
+
import { getPresetTheme, mergeThemes, themeToCssVariables } from "@lessonkit/themes";
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
const theme = mergeThemes(getPresetTheme("light"), { colors: { primary: "#0066cc" } });
|
|
21
|
+
const vars = themeToCssVariables(theme); // { "--lk-color-primary": "#0066cc", ... }
|
|
22
|
+
```
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
- `getPresetTheme(preset)` — `default` | `light` | `dark` | `brand` (full themes for catalog/validation)
|
|
24
|
+
**Presets:** `default`, `light`, `dark`, `brand` via `getPresetTheme()`
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
**Utilities:** `validateTheme()`, `mergeThemes()`, `themeToCssDeclarationBlock()`, `buildThemeCatalog()`
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
**Assets:** `theme-contract.v1.json`, `theme-catalog.v1.json`, `base.css`
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
- `mergeThemes(base, ...overrides)` — deep merge, last writer wins
|
|
37
|
-
- `themeToCssVariables(theme)` — flat `--lk-*` map (sorted keys)
|
|
38
|
-
- `themeToCssDeclarationBlock(theme)` — `:root { ... }` text
|
|
39
|
-
- `buildThemeCatalog()` — enumerable token metadata
|
|
30
|
+
Pair with `ThemeProvider` from `@lessonkit/react` for runtime theming.
|
|
40
31
|
|
|
41
|
-
|
|
32
|
+
## Docs
|
|
42
33
|
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
"imports": {
|
|
46
|
-
"@lessonkit/themes/theme-contract.v1.json": "./theme-contract.v1.json",
|
|
47
|
-
"@lessonkit/themes/theme-catalog.v1.json": "./theme-catalog.v1.json",
|
|
48
|
-
"@lessonkit/themes/base.css": "./base.css"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
```
|
|
34
|
+
[Theming reference](https://lessonkit.readthedocs.io/en/latest/reference/theming.html)
|
|
52
35
|
|
|
53
|
-
##
|
|
36
|
+
## License
|
|
54
37
|
|
|
55
|
-
|
|
38
|
+
Apache-2.0
|