@usefragments/core 1.10.1 → 1.10.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/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/tokens/scss.test.ts +32 -1
- package/src/tokens/scss.ts +12 -7
package/dist/index.js
CHANGED
|
@@ -2699,11 +2699,11 @@ function detectTokenPrefix(names) {
|
|
|
2699
2699
|
}
|
|
2700
2700
|
function parseScssVariables(content) {
|
|
2701
2701
|
const vars = /* @__PURE__ */ new Map();
|
|
2702
|
-
const scssVarRegex = /^\s*(\$[\w-]+)\s*:\s*(
|
|
2702
|
+
const scssVarRegex = /^\s*(\$[\w-]+)\s*:\s*([\s\S]*?)\s*(?:!default\s*)?;/gm;
|
|
2703
2703
|
let match;
|
|
2704
2704
|
while ((match = scssVarRegex.exec(content)) !== null) {
|
|
2705
2705
|
const name = match[1];
|
|
2706
|
-
const value = match[2].replace(/\s
|
|
2706
|
+
const value = match[2].replace(/\s*\/\/[^\n]*$/gm, "").replace(/\s+/g, " ").trim();
|
|
2707
2707
|
if (!vars.has(name)) {
|
|
2708
2708
|
vars.set(name, value);
|
|
2709
2709
|
}
|
|
@@ -2776,6 +2776,7 @@ function parseScssTokens(content, filePath = "tokens.scss") {
|
|
|
2776
2776
|
}
|
|
2777
2777
|
for (const [name, value] of scssVars) {
|
|
2778
2778
|
if (seenNames.has(name)) continue;
|
|
2779
|
+
if (value.startsWith("(")) continue;
|
|
2779
2780
|
seenNames.add(name);
|
|
2780
2781
|
tokens.push({
|
|
2781
2782
|
name,
|