@terrazzo/plugin-sass 0.10.4 → 2.0.0-alpha.2
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 +27 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @terrazzo/plugin-sass
|
|
2
2
|
|
|
3
|
+
## 2.0.0-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#568](https://github.com/terrazzoapp/terrazzo/pull/568) [`67c75be`](https://github.com/terrazzoapp/terrazzo/commit/67c75be78978cece52b61cf258ccc3a875e6af48) Thanks [@drwpow](https://github.com/drwpow)! - Fix border tokens not cascading correctly across modes
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`67c75be`](https://github.com/terrazzoapp/terrazzo/commit/67c75be78978cece52b61cf258ccc3a875e6af48)]:
|
|
10
|
+
- @terrazzo/plugin-css@2.0.0-alpha.2
|
|
11
|
+
- @terrazzo/cli@2.0.0-alpha.2
|
|
12
|
+
- @terrazzo/token-tools@2.0.0-alpha.2
|
|
13
|
+
|
|
14
|
+
## 2.0.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [#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.
|
|
19
|
+
|
|
20
|
+
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.
|
|
21
|
+
|
|
22
|
+
- [#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.
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- [#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.
|
|
27
|
+
|
|
28
|
+
- [#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
|
|
29
|
+
|
|
3
30
|
## 0.10.4
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Plugin } from "@terrazzo/parser";
|
|
|
2
2
|
import { CSSPluginOptions } from "@terrazzo/plugin-css";
|
|
3
3
|
|
|
4
4
|
//#region src/lib.d.ts
|
|
5
|
+
declare const FORMAT_ID = "sass";
|
|
5
6
|
interface SassPluginOptions {
|
|
6
7
|
/** Where to output CSS */
|
|
7
8
|
filename?: CSSPluginOptions['filename'];
|
|
@@ -15,5 +16,5 @@ declare const MIXIN_TYPOGRAPHY = "@mixin typography($tokenName, $modeName: \".\"
|
|
|
15
16
|
//#region src/index.d.ts
|
|
16
17
|
declare function pluginSass(options?: SassPluginOptions): Plugin;
|
|
17
18
|
//#endregion
|
|
18
|
-
export { FILE_HEADER, MIXIN_TOKEN, MIXIN_TYPOGRAPHY, SassPluginOptions, pluginSass as default };
|
|
19
|
+
export { FILE_HEADER, FORMAT_ID, MIXIN_TOKEN, MIXIN_TYPOGRAPHY, SassPluginOptions, pluginSass as default };
|
|
19
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/lib.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/lib.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;cAEa,SAAA;UAEI,iBAAA;;EAFJ,QAAA,CAAA,EAIA,gBAJS,CAAA,UAAA,CAAA;EAEL;EAAiB,OAAA,CAAA,EAItB,gBAJsB,CAAA,SAAA,CAAA;;AAItB,cAGC,WAAA,GAHD,gIAAA;AAAgB,cAWf,WAAA,GAXe,4VAAA;AAGf,cAoBA,gBAAA,GApBW,+bAAA;;;iBCJA,UAAA,WAAqB,oBAAoB"}
|
package/dist/index.js
CHANGED
|
@@ -2942,7 +2942,7 @@ const DEPTH_ROUNDING$1 = {
|
|
|
2942
2942
|
36: round_default$1(5),
|
|
2943
2943
|
48: round_default$1(6)
|
|
2944
2944
|
};
|
|
2945
|
-
const FORMAT_ID = "css";
|
|
2945
|
+
const FORMAT_ID$1 = "css";
|
|
2946
2946
|
|
|
2947
2947
|
//#endregion
|
|
2948
2948
|
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseNumber.js
|
|
@@ -6446,6 +6446,7 @@ function wildcardMatch(pattern, options) {
|
|
|
6446
6446
|
|
|
6447
6447
|
//#endregion
|
|
6448
6448
|
//#region src/lib.ts
|
|
6449
|
+
const FORMAT_ID = "sass";
|
|
6449
6450
|
const FILE_HEADER = `////
|
|
6450
6451
|
/// Autogenerated by ⛋ Terrazzo. DO NOT EDIT!
|
|
6451
6452
|
////
|
|
@@ -6482,7 +6483,7 @@ const MIXIN_TYPOGRAPHY = `@mixin typography($tokenName, $modeName: ".") {
|
|
|
6482
6483
|
//#region src/build.ts
|
|
6483
6484
|
function build({ getTransforms, options }) {
|
|
6484
6485
|
const tokens = getTransforms({
|
|
6485
|
-
format: FORMAT_ID,
|
|
6486
|
+
format: FORMAT_ID$1,
|
|
6486
6487
|
id: "*",
|
|
6487
6488
|
mode: "."
|
|
6488
6489
|
});
|
|
@@ -6502,7 +6503,7 @@ function build({ getTransforms, options }) {
|
|
|
6502
6503
|
output.push(");", "");
|
|
6503
6504
|
output.push("$__token-typography-mixins: (");
|
|
6504
6505
|
const typographyTokens = getTransforms({
|
|
6505
|
-
format:
|
|
6506
|
+
format: FORMAT_ID$1,
|
|
6506
6507
|
id: "*",
|
|
6507
6508
|
mode: ".",
|
|
6508
6509
|
$type: "typography"
|
|
@@ -6531,6 +6532,21 @@ function pluginSass(options) {
|
|
|
6531
6532
|
if (!config.plugins.some((p$3) => p$3.name === "@terrazzo/plugin-css")) throw new Error(`@terrazzo/plugin-sass relies on @terrazzo/plugin-css.
|
|
6532
6533
|
Please install @terrazzo/plugin-css and follow setup to add to your config.`);
|
|
6533
6534
|
},
|
|
6535
|
+
async transform({ getTransforms, setTransform }) {
|
|
6536
|
+
const tokens = getTransforms({ format: FORMAT_ID$1 });
|
|
6537
|
+
for (const token of tokens) {
|
|
6538
|
+
const value = `var(${token.localID})`;
|
|
6539
|
+
let listingName = `token("${token.token.id}")`;
|
|
6540
|
+
if (token.token.$type === "typography") listingName = token.mode !== "." ? `typography("${token.token.id}", "${token.mode}")` : `typography("${token.token.id}")`;
|
|
6541
|
+
setTransform(token.id, {
|
|
6542
|
+
format: FORMAT_ID,
|
|
6543
|
+
localID: token.id,
|
|
6544
|
+
value,
|
|
6545
|
+
mode: token.mode,
|
|
6546
|
+
meta: { "token-listing": { name: listingName } }
|
|
6547
|
+
});
|
|
6548
|
+
}
|
|
6549
|
+
},
|
|
6534
6550
|
async build({ getTransforms, outputFile }) {
|
|
6535
6551
|
const output = build({
|
|
6536
6552
|
getTransforms,
|
|
@@ -6542,5 +6558,5 @@ Please install @terrazzo/plugin-css and follow setup to add to your config.`);
|
|
|
6542
6558
|
}
|
|
6543
6559
|
|
|
6544
6560
|
//#endregion
|
|
6545
|
-
export { FILE_HEADER, MIXIN_TOKEN, MIXIN_TYPOGRAPHY, pluginSass as default };
|
|
6561
|
+
export { FILE_HEADER, FORMAT_ID, MIXIN_TOKEN, MIXIN_TYPOGRAPHY, pluginSass as default };
|
|
6546
6562
|
//# sourceMappingURL=index.js.map
|