@terrazzo/plugin-sass 0.8.1 → 0.9.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 +14 -0
- package/dist/index.js +34 -40
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @terrazzo/plugin-sass
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#497](https://github.com/terrazzoapp/terrazzo/pull/497) [`9b80fd4`](https://github.com/terrazzoapp/terrazzo/commit/9b80fd4edd1198021d8e309483e8cd8551fe79dc) Thanks [@bschlenk](https://github.com/bschlenk)! - - potential 5x speedup for @terrazzo/plugin-css
|
|
8
|
+
- removed isTokenMatch from @terrazzo/token-tools
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [[`9b80fd4`](https://github.com/terrazzoapp/terrazzo/commit/9b80fd4edd1198021d8e309483e8cd8551fe79dc)]:
|
|
13
|
+
- @terrazzo/cli@0.9.0
|
|
14
|
+
- @terrazzo/plugin-css@0.9.0
|
|
15
|
+
- @terrazzo/token-tools@0.9.0
|
|
16
|
+
|
|
3
17
|
## 0.8.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -3598,6 +3598,38 @@ const definition = {
|
|
|
3598
3598
|
};
|
|
3599
3599
|
var definition_default$14 = definition;
|
|
3600
3600
|
|
|
3601
|
+
//#endregion
|
|
3602
|
+
//#region ../token-tools/dist/css.js
|
|
3603
|
+
const CSS_VAR_RE = /(?:(\p{Uppercase_Letter}?[\p{Lowercase_Letter}\p{Number}]+|[\p{Uppercase_Letter}\p{Number}]+|[\u{80}-\u{10FFFF}\p{Number}]+)|.)/u;
|
|
3604
|
+
/**
|
|
3605
|
+
* Generate a valid CSS variable from any string
|
|
3606
|
+
* Code by @dfrankland
|
|
3607
|
+
*/
|
|
3608
|
+
function makeCSSVar(name, { prefix, wrapVar = false } = {}) {
|
|
3609
|
+
if (typeof name !== "string") throw new Error(`makeCSSVar() Expected string, received ${name}`);
|
|
3610
|
+
let property = name.split(CSS_VAR_RE).filter(Boolean).join("-");
|
|
3611
|
+
if (prefix && !property.startsWith(`${prefix}-`)) property = `${prefix}-${property}`;
|
|
3612
|
+
const finalProperty = `--${property}`.toLocaleLowerCase();
|
|
3613
|
+
return wrapVar ? `var(${finalProperty})` : finalProperty;
|
|
3614
|
+
}
|
|
3615
|
+
const converters = {
|
|
3616
|
+
a98: useMode(definition_default),
|
|
3617
|
+
hsl: useMode(definition_default$1),
|
|
3618
|
+
hsv: useMode(definition_default$2),
|
|
3619
|
+
hwb: useMode(definition_default$3),
|
|
3620
|
+
lab: useMode(definition_default$4),
|
|
3621
|
+
lch: useMode(definition_default$5),
|
|
3622
|
+
lrgb: useMode(definition_default$6),
|
|
3623
|
+
oklab: useMode(definition_default$7),
|
|
3624
|
+
oklch: useMode(definition_default$8),
|
|
3625
|
+
p3: useMode(definition_default$9),
|
|
3626
|
+
prophoto: useMode(definition_default$10),
|
|
3627
|
+
rec2020: useMode(definition_default$11),
|
|
3628
|
+
rgb: useMode(definition_default$12),
|
|
3629
|
+
xyz50: useMode(definition_default$13),
|
|
3630
|
+
xyz65: useMode(definition_default$14)
|
|
3631
|
+
};
|
|
3632
|
+
|
|
3601
3633
|
//#endregion
|
|
3602
3634
|
//#region ../../node_modules/.pnpm/wildcard-match@5.1.4/node_modules/wildcard-match/build/index.es.mjs
|
|
3603
3635
|
/**
|
|
@@ -3710,45 +3742,6 @@ function wildcardMatch(pattern, options) {
|
|
|
3710
3742
|
return fn$4;
|
|
3711
3743
|
}
|
|
3712
3744
|
|
|
3713
|
-
//#endregion
|
|
3714
|
-
//#region ../token-tools/dist/index.js
|
|
3715
|
-
/** Match token against globs */
|
|
3716
|
-
function isTokenMatch(tokenID, globPatterns) {
|
|
3717
|
-
return wildcardMatch(globPatterns)(tokenID);
|
|
3718
|
-
}
|
|
3719
|
-
|
|
3720
|
-
//#endregion
|
|
3721
|
-
//#region ../token-tools/dist/css.js
|
|
3722
|
-
const CSS_VAR_RE = /(?:(\p{Uppercase_Letter}?[\p{Lowercase_Letter}\p{Number}]+|[\p{Uppercase_Letter}\p{Number}]+|[\u{80}-\u{10FFFF}\p{Number}]+)|.)/u;
|
|
3723
|
-
/**
|
|
3724
|
-
* Generate a valid CSS variable from any string
|
|
3725
|
-
* Code by @dfrankland
|
|
3726
|
-
*/
|
|
3727
|
-
function makeCSSVar(name, { prefix, wrapVar = false } = {}) {
|
|
3728
|
-
if (typeof name !== "string") throw new Error(`makeCSSVar() Expected string, received ${name}`);
|
|
3729
|
-
let property = name.split(CSS_VAR_RE).filter(Boolean).join("-");
|
|
3730
|
-
if (prefix && !property.startsWith(`${prefix}-`)) property = `${prefix}-${property}`;
|
|
3731
|
-
const finalProperty = `--${property}`.toLocaleLowerCase();
|
|
3732
|
-
return wrapVar ? `var(${finalProperty})` : finalProperty;
|
|
3733
|
-
}
|
|
3734
|
-
const converters = {
|
|
3735
|
-
a98: useMode(definition_default),
|
|
3736
|
-
hsl: useMode(definition_default$1),
|
|
3737
|
-
hsv: useMode(definition_default$2),
|
|
3738
|
-
hwb: useMode(definition_default$3),
|
|
3739
|
-
lab: useMode(definition_default$4),
|
|
3740
|
-
lch: useMode(definition_default$5),
|
|
3741
|
-
lrgb: useMode(definition_default$6),
|
|
3742
|
-
oklab: useMode(definition_default$7),
|
|
3743
|
-
oklch: useMode(definition_default$8),
|
|
3744
|
-
p3: useMode(definition_default$9),
|
|
3745
|
-
prophoto: useMode(definition_default$10),
|
|
3746
|
-
rec2020: useMode(definition_default$11),
|
|
3747
|
-
rgb: useMode(definition_default$12),
|
|
3748
|
-
xyz50: useMode(definition_default$13),
|
|
3749
|
-
xyz65: useMode(definition_default$14)
|
|
3750
|
-
};
|
|
3751
|
-
|
|
3752
3745
|
//#endregion
|
|
3753
3746
|
//#region src/lib.ts
|
|
3754
3747
|
const FILE_HEADER = `////
|
|
@@ -3790,9 +3783,10 @@ function build({ getTransforms, options }) {
|
|
|
3790
3783
|
mode: "."
|
|
3791
3784
|
});
|
|
3792
3785
|
const output = [FILE_HEADER, ""];
|
|
3786
|
+
const shouldExclude = wildcardMatch(options?.exclude ?? []);
|
|
3793
3787
|
output.push("$__token-values: (");
|
|
3794
3788
|
for (const token of tokens) {
|
|
3795
|
-
if (
|
|
3789
|
+
if (shouldExclude(token.token.id)) continue;
|
|
3796
3790
|
if (token.token.$type === "typography") output.push(` "${token.token.id}": (
|
|
3797
3791
|
"__tz-error": 'This is a typography mixin. Use \`@include typography("${token.token.id}")\` instead.',
|
|
3798
3792
|
),`);
|