@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-01-30T15:21:31Z
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.14 KB
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
- "fadein",
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 fadein {
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
- * it's keys are used as keyframe stops and their values as their declarations
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 first one provides the declarations for the
25
- * 0% keyframe and the 2nd for the 100% keyframe.
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] : { 0: args[0], 100: args[1] };
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.4.4",
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.21",
39
- "@thi.ng/checks": "^3.4.21",
40
- "@thi.ng/errors": "^2.4.14",
41
- "@thi.ng/transducers": "^8.8.25"
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": "ded7c5e87ebc7f6279c24f183c24ff348db8f304\n"
129
+ "gitHead": "ce8202c237a367c4038d41919a8acf75e1122507\n"
130
130
  }