@unocss/transformer-directives 0.65.2 → 0.65.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/dist/index.mjs +5 -6
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -178,7 +178,7 @@ const screenRuleRE = /(@screen [^{]+)(.+)/g;
|
|
|
178
178
|
function handleScreen({ code, uno }, node) {
|
|
179
179
|
let breakpointName = "";
|
|
180
180
|
let prefix = "";
|
|
181
|
-
if (node.
|
|
181
|
+
if (node.prelude?.type === "Raw")
|
|
182
182
|
breakpointName = node.prelude.value.trim();
|
|
183
183
|
if (!breakpointName)
|
|
184
184
|
return;
|
|
@@ -203,8 +203,7 @@ function handleScreen({ code, uno }, node) {
|
|
|
203
203
|
return `@media (max-width: ${calcMaxWidthBySize(size)})`;
|
|
204
204
|
else if (prefix2 === "at")
|
|
205
205
|
return `@media (min-width: ${size})${variantEntries[idx + 1] ? ` and (max-width: ${calcMaxWidthBySize(variantEntries[idx + 1][1])})` : ""}`;
|
|
206
|
-
else
|
|
207
|
-
throw new Error(`breakpoint variant not supported: ${prefix2}`);
|
|
206
|
+
else throw new Error(`breakpoint variant not supported: ${prefix2}`);
|
|
208
207
|
}
|
|
209
208
|
return `@media (min-width: ${size})`;
|
|
210
209
|
};
|
|
@@ -264,11 +263,11 @@ async function transformDirectives(code, uno, options, filename, originalCode, o
|
|
|
264
263
|
offset
|
|
265
264
|
};
|
|
266
265
|
const processNode = async (node, _item, _list) => {
|
|
267
|
-
if (hasScreen && node.type === "Atrule")
|
|
266
|
+
if (hasScreen && node.type === "Atrule" && node.name === "screen")
|
|
268
267
|
handleScreen(ctx, node);
|
|
269
|
-
if (node.type === "Function")
|
|
268
|
+
else if (node.type === "Function")
|
|
270
269
|
await handleFunction(ctx, node);
|
|
271
|
-
if (hasApply && node.type === "Rule")
|
|
270
|
+
else if (hasApply && node.type === "Rule")
|
|
272
271
|
await handleApply(ctx, node);
|
|
273
272
|
};
|
|
274
273
|
walk(ast, (...args) => stack.push(processNode(...args)));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/transformer-directives",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.65.
|
|
4
|
+
"version": "0.65.4",
|
|
5
5
|
"description": "UnoCSS transformer for `@apply` directive",
|
|
6
6
|
"author": "hannoeru <me@hanlee.co>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"css-tree": "^3.1.0",
|
|
36
|
-
"@unocss/core": "0.65.
|
|
37
|
-
"@unocss/rule-utils": "0.65.
|
|
36
|
+
"@unocss/core": "0.65.4",
|
|
37
|
+
"@unocss/rule-utils": "0.65.4"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"magic-string": "^0.30.17"
|