@terrazzo/plugin-css 0.10.4 → 2.0.0-alpha.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/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @terrazzo/plugin-css
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#530](https://github.com/terrazzoapp/terrazzo/pull/530) [`370ed7b`](https://github.com/terrazzoapp/terrazzo/commit/370ed7b0f578a64824124145d7f4936536b37bb3) Thanks [@drwpow](https://github.com/drwpow)! - ⚠️ Breaking change: lint on plugins no longer runs on individual files, rather, the full set once merged.
|
|
8
|
+
|
|
9
|
+
If your lint plugin is not using the `src` context value, no changes are needed. If it is, you’ll need to instead read from the `sources` array, and look up sources with a token’s `source.loc` filename manually. This change was because lint rules now run on all files in one pass, essentially.
|
|
10
|
+
|
|
11
|
+
- [#530](https://github.com/terrazzoapp/terrazzo/pull/530) [`370ed7b`](https://github.com/terrazzoapp/terrazzo/commit/370ed7b0f578a64824124145d7f4936536b37bb3) Thanks [@drwpow](https://github.com/drwpow)! - ⚠️ [Plugin API] Minor breaking change: token.originalValue may be undefined for tokens created with $ref. This shouldn’t affect any tokens or plugins not using $refs. But going forward this value will be missing if the token was created dynamically via $ref.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#530](https://github.com/terrazzoapp/terrazzo/pull/530) [`370ed7b`](https://github.com/terrazzoapp/terrazzo/commit/370ed7b0f578a64824124145d7f4936536b37bb3) Thanks [@drwpow](https://github.com/drwpow)! - Validation moved to lint rules, which means token validation can be individually configured, and optionally extended.
|
|
16
|
+
|
|
17
|
+
- [#553](https://github.com/terrazzoapp/terrazzo/pull/553) [`e63a627`](https://github.com/terrazzoapp/terrazzo/commit/e63a6277f61282fb608744a8348689b16f977076) Thanks [@Sidnioulz](https://github.com/Sidnioulz)! - Add support for the Token Listing format
|
|
18
|
+
|
|
3
19
|
## 0.10.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -3456,7 +3456,7 @@ function toGamut(dest = "rgb", mode = "oklch", delta = differenceEuclidean("oklc
|
|
|
3456
3456
|
}
|
|
3457
3457
|
|
|
3458
3458
|
//#endregion
|
|
3459
|
-
//#region ../token-tools/dist/string-
|
|
3459
|
+
//#region ../token-tools/dist/string-D3-qmBT2.js
|
|
3460
3460
|
const HEX_RE = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i;
|
|
3461
3461
|
const CULORI_TO_CSS = {
|
|
3462
3462
|
a98: "a98-rgb",
|
|
@@ -3625,7 +3625,7 @@ function tokenToCulori(value) {
|
|
|
3625
3625
|
case "lab":
|
|
3626
3626
|
case "lab-d65":
|
|
3627
3627
|
case "oklab": {
|
|
3628
|
-
const [l, a, b] = value.components;
|
|
3628
|
+
const [l = 0, a = 0, b = 0] = value.components;
|
|
3629
3629
|
return {
|
|
3630
3630
|
mode: value.colorSpace === "lab-d65" ? "lab65" : value.colorSpace,
|
|
3631
3631
|
l,
|
|
@@ -4709,7 +4709,8 @@ function cssPlugin(options) {
|
|
|
4709
4709
|
format: FORMAT_ID,
|
|
4710
4710
|
localID,
|
|
4711
4711
|
value,
|
|
4712
|
-
mode
|
|
4712
|
+
mode,
|
|
4713
|
+
meta: { "token-listing": { name: localID } }
|
|
4713
4714
|
});
|
|
4714
4715
|
continue;
|
|
4715
4716
|
}
|
|
@@ -4720,12 +4721,20 @@ function cssPlugin(options) {
|
|
|
4720
4721
|
transformAlias,
|
|
4721
4722
|
color: { legacyHex }
|
|
4722
4723
|
});
|
|
4723
|
-
if (transformedValue !== void 0)
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4724
|
+
if (transformedValue !== void 0) {
|
|
4725
|
+
let listingName = localID;
|
|
4726
|
+
if (typeof transformedValue === "object" && generateShorthand({
|
|
4727
|
+
$type: token.$type,
|
|
4728
|
+
localID
|
|
4729
|
+
}) === void 0) listingName = void 0;
|
|
4730
|
+
setTransform(id, {
|
|
4731
|
+
format: FORMAT_ID,
|
|
4732
|
+
localID,
|
|
4733
|
+
value: transformedValue,
|
|
4734
|
+
mode,
|
|
4735
|
+
meta: { "token-listing": { name: listingName } }
|
|
4736
|
+
});
|
|
4737
|
+
}
|
|
4729
4738
|
}
|
|
4730
4739
|
}
|
|
4731
4740
|
},
|