@thi.ng/hiccup-css 2.4.4 → 2.5.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 +9 -1
- package/README.md +3 -3
- package/keyframes.d.ts +5 -4
- package/keyframes.js +4 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-
|
|
3
|
+
- **Last updated**: 2024-02-06T23:18:11Z
|
|
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
|
@@ -122,7 +122,7 @@ For Node.js REPL:
|
|
|
122
122
|
const hiccupCss = await import("@thi.ng/hiccup-css");
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 2.
|
|
125
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 2.15 KB
|
|
126
126
|
|
|
127
127
|
## Dependencies
|
|
128
128
|
|
|
@@ -476,7 +476,7 @@ css.css(
|
|
|
476
476
|
```ts
|
|
477
477
|
css.css(
|
|
478
478
|
css.at_keyframes(
|
|
479
|
-
"
|
|
479
|
+
"rgbfade",
|
|
480
480
|
{
|
|
481
481
|
0: {
|
|
482
482
|
color: "red"
|
|
@@ -494,7 +494,7 @@ css.css(
|
|
|
494
494
|
```
|
|
495
495
|
|
|
496
496
|
```css
|
|
497
|
-
@keyframes
|
|
497
|
+
@keyframes rgbfade {
|
|
498
498
|
|
|
499
499
|
0% {
|
|
500
500
|
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.0",
|
|
4
4
|
"description": "CSS from nested JS data structures",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -35,10 +35,10 @@
|
|
|
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.22",
|
|
39
|
+
"@thi.ng/checks": "^3.4.22",
|
|
40
|
+
"@thi.ng/errors": "^2.4.15",
|
|
41
|
+
"@thi.ng/transducers": "^8.9.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@microsoft/api-extractor": "^7.39.0",
|
|
@@ -126,5 +126,5 @@
|
|
|
126
126
|
],
|
|
127
127
|
"year": 2016
|
|
128
128
|
},
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "ce8202c237a367c4038d41919a8acf75e1122507\n"
|
|
130
130
|
}
|