@su-labs/theme 22.1.0 → 22.2.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 +12 -0
- package/README.md +5 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [22.2.0] - 2026-11-07
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- `target` option: the element the theme is applied to (default: `<html>`), to theme one component instead of the whole page
|
|
14
|
+
- `storage` option: where the selected theme is saved (default: `localStorage`); pass `createSuCookieStorage({ domain })` from `@su-labs/core` to share it across subdomains
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Requires `@su-labs/core` 1.1.0 or later
|
|
18
|
+
- Package homepage now points to the website with a live demo
|
|
19
|
+
|
|
8
20
|
## [22.1.0] - 2026-11-05
|
|
9
21
|
|
|
10
22
|
### Changed
|
package/README.md
CHANGED
|
@@ -221,6 +221,8 @@ type SuThemeName = 'light' | 'dark' | 'contrast' | 'custom' | 'system';
|
|
|
221
221
|
|
|
222
222
|
interface SuThemeConfig {
|
|
223
223
|
storageKey?: string; // Default: 'su:theme'
|
|
224
|
+
storage?: SuStorage; // Default: localStorage
|
|
225
|
+
target?: HTMLElement; // Default: <html>
|
|
224
226
|
cssVarPrefix?: string; // Default: '--su-theme-'
|
|
225
227
|
defaultTheme?: SuThemeName; // Default: 'system'
|
|
226
228
|
themes?: {
|
|
@@ -235,7 +237,9 @@ The service can be configured to fit your application's needs.
|
|
|
235
237
|
|
|
236
238
|
| Option | Description | Default Value |
|
|
237
239
|
|--------------------|---------------------------------------------------------------|------------------|
|
|
238
|
-
| `storageKey` | The key used to persist the selected theme
|
|
240
|
+
| `storageKey` | The key used to persist the selected theme. | `'su:theme'` |
|
|
241
|
+
| `storage` | Where the theme is saved. Use `createSuCookieStorage({ domain })` from `@su-labs/core` to share it across subdomains. | `localStorage` |
|
|
242
|
+
| `target` | Element the theme is applied to. Pass a component's element to theme only that part of the page. | `<html>` |
|
|
239
243
|
| `cssVarPrefix` | The prefix for all CSS variables managed by the service. | `'--su-theme-'` |
|
|
240
244
|
| `defaultTheme` | The theme to use if no preference is saved in `localStorage`. | `'system'` |
|
|
241
245
|
| `themes` | An object with custom CSS variable overrides for each theme. | `undefined` |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@su-labs/theme",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.2.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"angular",
|
|
6
6
|
"theme",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"system-theme",
|
|
19
19
|
"prefers-color-scheme"
|
|
20
20
|
],
|
|
21
|
-
"homepage": "https://
|
|
21
|
+
"homepage": "https://su-labs.dev/theme/",
|
|
22
22
|
"author": {
|
|
23
23
|
"name": "Yevheniy Alekseyev",
|
|
24
24
|
"email": "yev.alekseyev@gmail.com",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@angular/core": "^22.0.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@su-labs/core": "^1.
|
|
40
|
+
"@su-labs/core": "^1.1.0",
|
|
41
41
|
"tslib": "^2.3.0"
|
|
42
42
|
},
|
|
43
43
|
"sideEffects": false,
|