@thi.ng/hiccup-css 2.3.2 → 2.3.4

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**: 2023-12-19T11:01:47Z
3
+ - **Last updated**: 2023-12-22T17:55:14Z
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.3.4](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup-css@2.3.4) (2023-12-22)
13
+
14
+ #### 🩹 Bug fixes
15
+
16
+ - fix media query `not` operator ([f40800b](https://github.com/thi-ng/umbrella/commit/f40800b))
17
+ - wrap sub-query in parens
18
+ - update tests
19
+
12
20
  ## [2.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup-css@2.3.0) (2023-12-18)
13
21
 
14
22
  #### 🚀 Features
package/README.md CHANGED
@@ -117,7 +117,7 @@ For Node.js REPL:
117
117
  const hiccupCss = await import("@thi.ng/hiccup-css");
118
118
  ```
119
119
 
120
- Package sizes (brotli'd, pre-treeshake): ESM: 2.13 KB
120
+ Package sizes (brotli'd, pre-treeshake): ESM: 2.14 KB
121
121
 
122
122
  ## Dependencies
123
123
 
@@ -403,9 +403,12 @@ and ALWAYS combined using `and`:
403
403
  |------------------------|----------------------|
404
404
  | `"min-width": "10rem"` | `(min-width: 10rem)` |
405
405
  | `print: true` | `print` |
406
- | `print: false` | `not print` |
406
+ | `print: false` | `(not print)` |
407
407
  | `print: "only"` | `only print` |
408
408
 
409
+ Note: In CSS Level 3, the `not` operator can't be used to negate an individual
410
+ media feature expression, only an entire media query.
411
+
409
412
  ```ts
410
413
  css.css(
411
414
  css.at_media(
package/conditional.js CHANGED
@@ -20,7 +20,7 @@ const formatCond = (cond) => {
20
20
  if (v === true) {
21
21
  v = MEDIA_TYPES.has(c) ? c : `(${c})`;
22
22
  } else if (v === false) {
23
- v = "not " + (MEDIA_TYPES.has(c) ? c : `(${c})`);
23
+ v = `(not ${MEDIA_TYPES.has(c) ? c : `(${c})`})`;
24
24
  } else if (v === "only") {
25
25
  v += " " + c;
26
26
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/hiccup-css",
3
- "version": "2.3.2",
3
+ "version": "2.3.4",
4
4
  "description": "CSS from nested JS data structures",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -126,5 +126,5 @@
126
126
  ],
127
127
  "year": 2016
128
128
  },
129
- "gitHead": "36d93175f8fbc0190c3c96a9ac0016a9663e9a80\n"
129
+ "gitHead": "a30bdb0136223fe2e413a1d27a71d3bcff1dfd53\n"
130
130
  }
package/units.js CHANGED
@@ -1,6 +1,6 @@
1
1
  let PRECISION = 4;
2
2
  const setPrecision = (n) => PRECISION = n;
3
- const ff = (x) => x === (x | 0) ? String(x) : x.toFixed(PRECISION).replace(/^0./, ".").replace(/0+$/, "");
3
+ const ff = (x) => x === (x | 0) ? String(x) : x.toFixed(PRECISION).replace(/^0./, ".").replace(/^-0./, "-.").replace(/0+$/, "");
4
4
  const em = (x) => `${ff(x)}em`;
5
5
  const ex = (x) => `${ff(x)}ex`;
6
6
  const rem = (x) => `${ff(x)}rem`;