@teacss/postcss 0.3.5 → 0.3.7
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/README.md +11 -0
- package/dist/esm.mjs +14 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -31,6 +31,17 @@ export default {
|
|
|
31
31
|
};
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
Runners that serialize the PostCSS configuration to workers (such as
|
|
35
|
+
Next.js) load the plugin by package name through its default export:
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
export default {
|
|
39
|
+
plugins: {
|
|
40
|
+
"@teacss/postcss": {},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
```
|
|
44
|
+
|
|
34
45
|
```css
|
|
35
46
|
@preset "standard";
|
|
36
47
|
@source "./src/**/*.{ts,tsx,html}";
|
package/dist/esm.mjs
CHANGED
|
@@ -186,6 +186,18 @@ function replaceRuleWithCss(rule, generatedCss) {
|
|
|
186
186
|
});
|
|
187
187
|
rule.replaceWith(css);
|
|
188
188
|
}
|
|
189
|
+
const ENTRY_STATEMENT_DIRECTIVES = /* @__PURE__ */ new Set([
|
|
190
|
+
"preset",
|
|
191
|
+
"source",
|
|
192
|
+
"shortcut",
|
|
193
|
+
"safelist"
|
|
194
|
+
]);
|
|
195
|
+
function removeEntryDirectives(root) {
|
|
196
|
+
root.walkAtRules((rule) => {
|
|
197
|
+
if (rule.parent !== root) return;
|
|
198
|
+
if (ENTRY_STATEMENT_DIRECTIVES.has(rule.name) ? rule.nodes === void 0 : rule.name === "custom" && rule.nodes !== void 0) rule.remove();
|
|
199
|
+
});
|
|
200
|
+
}
|
|
189
201
|
function replaceTeacssAtRules(root, generation, directiveName) {
|
|
190
202
|
const emittedLayers = /* @__PURE__ */ new Set();
|
|
191
203
|
root.walkAtRules(directiveName, (rule) => {
|
|
@@ -326,7 +338,7 @@ function createPlugin(options) {
|
|
|
326
338
|
isScanTarget = true;
|
|
327
339
|
return false;
|
|
328
340
|
}
|
|
329
|
-
if (directiveNames.has(node.name)) isTarget = true;
|
|
341
|
+
if (directiveNames.has(node.name) || ENTRY_STATEMENT_DIRECTIVES.has(node.name) || node.name === "custom") isTarget = true;
|
|
330
342
|
} else if (!isTarget && node.type === "decl" && (hasThemeFn(node.value) || hasIconFn(node.value))) isTarget = true;
|
|
331
343
|
});
|
|
332
344
|
if (!isTarget) return;
|
|
@@ -372,6 +384,7 @@ function createPlugin(options) {
|
|
|
372
384
|
await parseApply(root, generator, directiveMap.apply);
|
|
373
385
|
await parseTheme(root, generator);
|
|
374
386
|
await parseScreen(root, generator, directiveMap.screen);
|
|
387
|
+
removeEntryDirectives(root);
|
|
375
388
|
if (!isScanTarget) {
|
|
376
389
|
if (result.opts.from) addDependency(from);
|
|
377
390
|
return;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e={}){let t;return{postcssPlugin:e.directiveMap?.teacss||`teacss`,plugins:[async(n,r)=>(t||=import(`@teacss/postcss/esm`).then(t=>t.createPlugin(e)),await(await t)(n,r))]}}e.postcss=!0;export{e as pluginTeacss};
|
|
1
|
+
function e(e={}){let t;return{postcssPlugin:e.directiveMap?.teacss||`teacss`,plugins:[async(n,r)=>(t||=import(`@teacss/postcss/esm`).then(t=>t.createPlugin(e)),await(await t)(n,r))]}}e.postcss=!0;export{e as default,e as pluginTeacss};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teacss/postcss",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "PostCSS plugin for TeaCSS — generate utilities within a PostCSS pipeline.",
|
|
5
5
|
"homepage": "https://css.teasim.com",
|
|
6
6
|
"funding": "https://github.com/sponsors/billgo",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"dev": "tsdown --watch"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@teacss/config": "0.3.
|
|
27
|
-
"@teacss/core": "0.3.
|
|
28
|
-
"@teacss/directives": "0.3.
|
|
29
|
-
"@teacss/rule-helpers": "0.3.
|
|
30
|
-
"@teacss/runtime": "0.3.
|
|
26
|
+
"@teacss/config": "0.3.7",
|
|
27
|
+
"@teacss/core": "0.3.7",
|
|
28
|
+
"@teacss/directives": "0.3.7",
|
|
29
|
+
"@teacss/rule-helpers": "0.3.7",
|
|
30
|
+
"@teacss/runtime": "0.3.7",
|
|
31
31
|
"css-tree": "^3.2.1",
|
|
32
32
|
"tinyglobby": "^0.2.17"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@teacss/preset-standard": "0.3.
|
|
35
|
+
"@teacss/preset-standard": "0.3.7",
|
|
36
36
|
"@types/css-tree": "^2.3.11",
|
|
37
37
|
"consola": "^3.4.2",
|
|
38
38
|
"magic-string": "^1.1.0",
|