@su-labs/font-size 22.1.0 → 22.2.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 +16 -0
- package/README.md +6 -2
- package/package.json +3 -3
- package/types/su-labs-font-size.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ 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.1] - 2026-11-16
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Uses `@su-labs/core` 1.9.0 (was ^1.1.0), the same version as every other `@su-labs` package, so apps using several of them install core once
|
|
14
|
+
|
|
15
|
+
## [22.2.0] - 2026-11-07
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
- `storage` option: where the size is saved (default: `localStorage`); pass `createSuCookieStorage({ domain })` from `@su-labs/core` to share it across subdomains
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- Requires `@su-labs/core` 1.1.0 or later
|
|
22
|
+
- Package homepage now points to the website with a live demo
|
|
23
|
+
|
|
8
24
|
## [22.1.0] - 2026-11-05
|
|
9
25
|
|
|
10
26
|
### Changed
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
An accessible Angular service for managing font size preferences. Provides reactive controls for text scaling, user preference persistence, and WCAG-compliant font size management.
|
|
15
15
|
|
|
16
|
-
> **Not using Angular?** The same font size controls are available for React, Svelte and vanilla JavaScript in [`@su-labs/core`](https://www.npmjs.com/package/@su-labs/core). See the [installation guides](https://github.com/Greezaaa/settings-utils-lib/blob/main/docs/README.md).
|
|
16
|
+
> **Not using Angular?** The same font size controls are available for React, Vue, Svelte and vanilla JavaScript in [`@su-labs/core`](https://www.npmjs.com/package/@su-labs/core). See the [installation guides](https://github.com/Greezaaa/settings-utils-lib/blob/main/docs/README.md).
|
|
17
17
|
|
|
18
18
|
## Table of Contents
|
|
19
19
|
|
|
@@ -59,6 +59,8 @@ You can install this library via npm:
|
|
|
59
59
|
npm install @su-labs/font-size
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
+
On Angular 19 or 20, install the matching version: `npm install @su-labs/font-size@ng19` or `npm install @su-labs/font-size@ng20`.
|
|
63
|
+
|
|
62
64
|
## Peer Dependencies
|
|
63
65
|
|
|
64
66
|
This library requires the following peer dependencies:
|
|
@@ -197,6 +199,7 @@ type FontSizeConfig = {
|
|
|
197
199
|
maxSize: number;
|
|
198
200
|
step: number;
|
|
199
201
|
storageKey?: string;
|
|
202
|
+
storage?: SuStorage; // Default: localStorage
|
|
200
203
|
cssVarName?: string;
|
|
201
204
|
};
|
|
202
205
|
```
|
|
@@ -209,7 +212,8 @@ type FontSizeConfig = {
|
|
|
209
212
|
| `minSize` | Smallest allowed size | `10` |
|
|
210
213
|
| `maxSize` | Largest allowed size | `22` |
|
|
211
214
|
| `step` | Pixels added or removed by `increase()` / `decrease()` | `2` |
|
|
212
|
-
| `storageKey` | The key used to persist the size
|
|
215
|
+
| `storageKey` | The key used to persist the size | `'su:font-size'` |
|
|
216
|
+
| `storage` | Where the size is saved. Use `createSuCookieStorage({ domain })` from `@su-labs/core` to share it across subdomains | `localStorage` |
|
|
213
217
|
| `cssVarName` | CSS custom property set on `<html>` | `'--base-font-size'` |
|
|
214
218
|
|
|
215
219
|
Invalid combinations are corrected: a maximum below the minimum is raised to the minimum, the default is clamped to the range, and a step of zero or less becomes `1`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@su-labs/font-size",
|
|
3
|
-
"version": "22.1
|
|
3
|
+
"version": "22.2.1",
|
|
4
4
|
"description": "A lightweight Angular service for dynamic font size management.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"signals",
|
|
19
19
|
"localstorage"
|
|
20
20
|
],
|
|
21
|
-
"homepage": "https://
|
|
21
|
+
"homepage": "https://su-labs.dev/font-size/",
|
|
22
22
|
"author": {
|
|
23
23
|
"name": "Yevheniy Alekseyev",
|
|
24
24
|
"email": "yev.alekseyev@gmail.com",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@angular/core": "^22.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@su-labs/core": "
|
|
32
|
+
"@su-labs/core": "1.9.0",
|
|
33
33
|
"tslib": "^2.3.0"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { OnDestroy } from "@angular/core";
|
|
3
3
|
import { SuFontSizeConfig, SuFontSizeLimits } from "@su-labs/core/font-size";
|
|
4
|
-
/** Font size configuration: limits and step in pixels, plus optional storage key and CSS variable name */
|
|
5
|
-
export type FontSizeConfig = SuFontSizeLimits & Pick<SuFontSizeConfig, 'storageKey' | 'cssVarName'>;
|
|
4
|
+
/** Font size configuration: limits and step in pixels, plus optional storage, storage key and CSS variable name */
|
|
5
|
+
export type FontSizeConfig = SuFontSizeLimits & Pick<SuFontSizeConfig, 'storage' | 'storageKey' | 'cssVarName'>;
|
|
6
6
|
/**
|
|
7
7
|
* Angular service for managing the font size.
|
|
8
8
|
*
|