@thi.ng/hiccup-css 2.4.5 → 2.5.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 +9 -1
- package/README.md +13 -3
- package/keyframes.d.ts +5 -4
- package/keyframes.js +4 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-
|
|
3
|
+
- **Last updated**: 2024-02-10T08:59:56Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,14 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
## [2.5.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup-css@2.5.0) (2024-02-06)
|
|
13
|
+
|
|
14
|
+
#### 🚀 Features
|
|
15
|
+
|
|
16
|
+
- at_keyframes() vararg handling ([62df789](https://github.com/thi-ng/umbrella/commit/62df789))
|
|
17
|
+
- update to support more than just from/to keyframe args
|
|
18
|
+
- if given more space them equally across [0,100] interval
|
|
19
|
+
|
|
12
20
|
## [2.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup-css@2.4.0) (2024-01-23)
|
|
13
21
|
|
|
14
22
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
<!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
|
|
3
|
+
> [!IMPORTANT]
|
|
4
|
+
> ‼️ Announcing the thi.ng user survey 2024 📋
|
|
5
|
+
>
|
|
6
|
+
> [Please participate in the survey here!](https://forms.gle/XacbSDEmQMPZg8197)\
|
|
7
|
+
> (open until end of February)
|
|
8
|
+
>
|
|
9
|
+
> **To achieve a better sample size, I'd highly appreciate if you could
|
|
10
|
+
> circulate the link to this survey in your own networks.**
|
|
11
|
+
>
|
|
12
|
+
> [Discussion](https://github.com/thi-ng/umbrella/discussions/447)
|
|
3
13
|
|
|
4
14
|
# 
|
|
5
15
|
|
|
@@ -122,7 +132,7 @@ For Node.js REPL:
|
|
|
122
132
|
const hiccupCss = await import("@thi.ng/hiccup-css");
|
|
123
133
|
```
|
|
124
134
|
|
|
125
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 2.
|
|
135
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 2.15 KB
|
|
126
136
|
|
|
127
137
|
## Dependencies
|
|
128
138
|
|
|
@@ -476,7 +486,7 @@ css.css(
|
|
|
476
486
|
```ts
|
|
477
487
|
css.css(
|
|
478
488
|
css.at_keyframes(
|
|
479
|
-
"
|
|
489
|
+
"rgbfade",
|
|
480
490
|
{
|
|
481
491
|
0: {
|
|
482
492
|
color: "red"
|
|
@@ -494,7 +504,7 @@ css.css(
|
|
|
494
504
|
```
|
|
495
505
|
|
|
496
506
|
```css
|
|
497
|
-
@keyframes
|
|
507
|
+
@keyframes rgbfade {
|
|
498
508
|
|
|
499
509
|
0% {
|
|
500
510
|
color: red;
|
package/keyframes.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { RuleFn } from "./api.js";
|
|
2
2
|
export type Keyframe = Record<string, any>;
|
|
3
3
|
/**
|
|
4
|
-
* Rule function for `@keyframes`. If a single declaration object is given,
|
|
5
|
-
*
|
|
4
|
+
* Rule function for `@keyframes`. If a single declaration object is given, it's
|
|
5
|
+
* keys are used as keyframe stops and their values as their declarations
|
|
6
6
|
* objects. This way any number of stops can be specified.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
@@ -21,8 +21,9 @@ export type Keyframe = Record<string, any>;
|
|
|
21
21
|
* // }
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
24
|
-
* If called with two objects, the
|
|
25
|
-
*
|
|
24
|
+
* If called with two or more objects, the each object provides the declarations
|
|
25
|
+
* for equally spaced keyframes, e.g. if given 3 objects, their respective times
|
|
26
|
+
* will be at 0%, 50%, 100%.
|
|
26
27
|
*
|
|
27
28
|
* @example
|
|
28
29
|
* ```ts
|
package/keyframes.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { formatDecls, indent } from "./impl.js";
|
|
2
2
|
function at_keyframes(id, ...args) {
|
|
3
|
-
const stops = args.length === 1 ? args[0] :
|
|
3
|
+
const stops = args.length === 1 ? args[0] : args.reduce((acc, x, i) => {
|
|
4
|
+
acc[i / (args.length - 1) * 100 | 0] = x;
|
|
5
|
+
return acc;
|
|
6
|
+
}, {});
|
|
4
7
|
return (acc, opts) => {
|
|
5
8
|
const outer = indent(opts);
|
|
6
9
|
opts.depth++;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/hiccup-css",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "CSS from nested JS data structures",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"test": "bun test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.9.
|
|
39
|
-
"@thi.ng/checks": "^3.4.
|
|
40
|
-
"@thi.ng/errors": "^2.4.
|
|
41
|
-
"@thi.ng/transducers": "^8.
|
|
38
|
+
"@thi.ng/api": "^8.9.23",
|
|
39
|
+
"@thi.ng/checks": "^3.4.23",
|
|
40
|
+
"@thi.ng/errors": "^2.4.16",
|
|
41
|
+
"@thi.ng/transducers": "^8.9.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@microsoft/api-extractor": "^7.
|
|
45
|
-
"esbuild": "^0.
|
|
44
|
+
"@microsoft/api-extractor": "^7.40.1",
|
|
45
|
+
"esbuild": "^0.20.0",
|
|
46
46
|
"rimraf": "^5.0.5",
|
|
47
|
-
"typedoc": "^0.25.
|
|
47
|
+
"typedoc": "^0.25.7",
|
|
48
48
|
"typescript": "^5.3.3"
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
@@ -126,5 +126,5 @@
|
|
|
126
126
|
],
|
|
127
127
|
"year": 2016
|
|
128
128
|
},
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "e5e7d5c6ed2eadee7a91d59cbd0c86ce880ab1c5\n"
|
|
130
130
|
}
|