@weapp-tailwindcss/postcss 3.2.9 → 3.2.11
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 +4 -4
- package/README.zh-CN.md +9 -0
- package/dist/compat/lynx-css.d.ts +2 -0
- package/dist/index.cjs +95 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +95 -6
- package/package.json +6 -6
- package/README.en.md +0 -9
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# @weapp-tailwindcss/postcss
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> English | [简体中文](./README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This package is the CSS processing core of weapp-tailwindcss. It handles PostCSS AST transforms, selector compatibility, platform differences, and Tailwind output post-processing for mini programs.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Website
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
For setup guides, configuration references, and framework examples, see the [official weapp-tailwindcss documentation](https://tw.icebreaker.top).
|
package/README.zh-CN.md
ADDED
package/dist/index.cjs
CHANGED
|
@@ -1779,8 +1779,8 @@ function resolveNodes(nodes, variables, resolving) {
|
|
|
1779
1779
|
const fallback = commaIndex >= 0 ? postcss_value_parser.default.stringify(node.nodes.slice(commaIndex + 1)).trim() : "";
|
|
1780
1780
|
const configured = variables.get(variable.value);
|
|
1781
1781
|
let replacement;
|
|
1782
|
-
if (configured !== void 0 && !resolving.has(variable.value)) replacement = resolveThemeValue(configured, variables, /* @__PURE__ */ new Set([...resolving, variable.value]));
|
|
1783
|
-
else if (fallback && isTailwindcssV4ThemeVariable(variable.value)) replacement = resolveThemeValue(fallback, variables, resolving);
|
|
1782
|
+
if (configured !== void 0 && !resolving.has(variable.value)) replacement = resolveThemeValue$1(configured, variables, /* @__PURE__ */ new Set([...resolving, variable.value]));
|
|
1783
|
+
else if (fallback && isTailwindcssV4ThemeVariable(variable.value)) replacement = resolveThemeValue$1(fallback, variables, resolving);
|
|
1784
1784
|
if (replacement === void 0) {
|
|
1785
1785
|
resolveNodes(node.nodes, variables, resolving);
|
|
1786
1786
|
continue;
|
|
@@ -1790,7 +1790,7 @@ function resolveNodes(nodes, variables, resolving) {
|
|
|
1790
1790
|
index += replacementNodes.length - 1;
|
|
1791
1791
|
}
|
|
1792
1792
|
}
|
|
1793
|
-
function resolveThemeValue(value, variables, resolving = /* @__PURE__ */ new Set()) {
|
|
1793
|
+
function resolveThemeValue$1(value, variables, resolving = /* @__PURE__ */ new Set()) {
|
|
1794
1794
|
if (!value.includes("var(")) return value;
|
|
1795
1795
|
const parsed = (0, postcss_value_parser.default)(value);
|
|
1796
1796
|
resolveNodes(parsed.nodes, variables, resolving);
|
|
@@ -1844,7 +1844,7 @@ function consumeUniAppXSystemRootTheme(root, customPropertyValues) {
|
|
|
1844
1844
|
const carriers = new Set(carrierRules);
|
|
1845
1845
|
root.walkDecls((decl) => {
|
|
1846
1846
|
if (decl.parent?.type === "rule" && carriers.has(decl.parent)) return;
|
|
1847
|
-
decl.value = resolveThemeValue(decl.value, variables);
|
|
1847
|
+
decl.value = resolveThemeValue$1(decl.value, variables);
|
|
1848
1848
|
});
|
|
1849
1849
|
}
|
|
1850
1850
|
splitUnresolvedAuthorVariableFallbacks(root, variables);
|
|
@@ -2118,6 +2118,92 @@ function resolvePostcssStyleBranchProfile(options) {
|
|
|
2118
2118
|
return resolvePostcssFrameworkProfile(options);
|
|
2119
2119
|
}
|
|
2120
2120
|
//#endregion
|
|
2121
|
+
//#region src/compat/lynx-css.ts
|
|
2122
|
+
const tailwindThemePropertyPatterns = [
|
|
2123
|
+
/^--aspect-/,
|
|
2124
|
+
/^--animate-/,
|
|
2125
|
+
/^--blur-/,
|
|
2126
|
+
/^--breakpoint-/,
|
|
2127
|
+
/^--color-/,
|
|
2128
|
+
/^--container-/,
|
|
2129
|
+
/^--drop-shadow-/,
|
|
2130
|
+
/^--ease-/,
|
|
2131
|
+
/^--default-font-/,
|
|
2132
|
+
/^--font-/,
|
|
2133
|
+
/^--font-weight-/,
|
|
2134
|
+
/^--inset-shadow-/,
|
|
2135
|
+
/^--leading-/,
|
|
2136
|
+
/^--perspective-/,
|
|
2137
|
+
/^--radius-/,
|
|
2138
|
+
/^--shadow-/,
|
|
2139
|
+
/^--text-/,
|
|
2140
|
+
/^--tracking-/,
|
|
2141
|
+
/^--spacing$/
|
|
2142
|
+
];
|
|
2143
|
+
function isTailwindThemeProperty(property) {
|
|
2144
|
+
return tailwindThemePropertyPatterns.some((pattern) => pattern.test(property));
|
|
2145
|
+
}
|
|
2146
|
+
function isThemeScopeSelector(selector) {
|
|
2147
|
+
return selector.split(",").some((part) => {
|
|
2148
|
+
const normalized = part.trim();
|
|
2149
|
+
return normalized === ":root" || normalized === ":host";
|
|
2150
|
+
});
|
|
2151
|
+
}
|
|
2152
|
+
function collectTailwindThemeProperties(root) {
|
|
2153
|
+
const values = /* @__PURE__ */ new Map();
|
|
2154
|
+
root.walkRules((rule) => {
|
|
2155
|
+
if (!isThemeScopeSelector(rule.selector)) return;
|
|
2156
|
+
rule.walkDecls((decl) => {
|
|
2157
|
+
if (isTailwindThemeProperty(decl.prop)) values.set(decl.prop, decl.value.trim());
|
|
2158
|
+
});
|
|
2159
|
+
});
|
|
2160
|
+
return values;
|
|
2161
|
+
}
|
|
2162
|
+
function resolveThemeValue(value, properties, resolving = /* @__PURE__ */ new Set()) {
|
|
2163
|
+
if (!value.includes("var(")) return value;
|
|
2164
|
+
const parsed = (0, postcss_value_parser.default)(value);
|
|
2165
|
+
parsed.walk((node) => {
|
|
2166
|
+
if (node.type !== "function" || node.value.toLowerCase() !== "var") return;
|
|
2167
|
+
const property = node.nodes.find((child) => child.type === "word" && child.value.startsWith("--"))?.value;
|
|
2168
|
+
if (!property || resolving.has(property)) return;
|
|
2169
|
+
const propertyValue = properties.get(property);
|
|
2170
|
+
if (!propertyValue) return;
|
|
2171
|
+
const nextResolving = new Set(resolving);
|
|
2172
|
+
nextResolving.add(property);
|
|
2173
|
+
const resolved = resolveThemeValue(propertyValue, properties, nextResolving);
|
|
2174
|
+
const mutableNode = node;
|
|
2175
|
+
mutableNode.type = "word";
|
|
2176
|
+
mutableNode.value = resolved;
|
|
2177
|
+
delete mutableNode.nodes;
|
|
2178
|
+
});
|
|
2179
|
+
return parsed.toString();
|
|
2180
|
+
}
|
|
2181
|
+
function removeConsumedThemeProperties(root) {
|
|
2182
|
+
root.walkRules((rule) => {
|
|
2183
|
+
if (!isThemeScopeSelector(rule.selector)) return;
|
|
2184
|
+
rule.walkDecls((decl) => {
|
|
2185
|
+
if (isTailwindThemeProperty(decl.prop)) decl.remove();
|
|
2186
|
+
});
|
|
2187
|
+
if (rule.nodes.length === 0) rule.remove();
|
|
2188
|
+
});
|
|
2189
|
+
}
|
|
2190
|
+
/** 将 Lynx 原生无法继承的 Tailwind theme 变量静态化。 */
|
|
2191
|
+
function transformLynxCssCompat(css) {
|
|
2192
|
+
try {
|
|
2193
|
+
const root = postcss.default.parse(css);
|
|
2194
|
+
const properties = collectTailwindThemeProperties(root);
|
|
2195
|
+
if (properties.size === 0) return css;
|
|
2196
|
+
root.walkDecls((decl) => {
|
|
2197
|
+
decl.value = resolveThemeValue(decl.value, properties);
|
|
2198
|
+
});
|
|
2199
|
+
removeConsumedThemeProperties(root);
|
|
2200
|
+
(0, postcss.default)([(0, _weapp_tailwindcss_postcss_calc.default)()]).process(root, { from: void 0 }).sync();
|
|
2201
|
+
return root.toString();
|
|
2202
|
+
} catch {
|
|
2203
|
+
return css;
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
//#endregion
|
|
2121
2207
|
//#region src/compat/mini-program-css/cascade-layers.ts
|
|
2122
2208
|
const LAYER_PATH_SEPARATOR = "";
|
|
2123
2209
|
const LAYER_INSERTION_ANCHOR = "__weapp_tailwindcss_layer_anchor__";
|
|
@@ -4229,7 +4315,10 @@ function isMiniProgramGeneratorTarget(target) {
|
|
|
4229
4315
|
return target !== "web";
|
|
4230
4316
|
}
|
|
4231
4317
|
function finalizeGeneratedCss(css, target, styleOptions, webCompat) {
|
|
4232
|
-
if (target === "web")
|
|
4318
|
+
if (target === "web") {
|
|
4319
|
+
const webCss = transformWebCssCompat(css, webCompat);
|
|
4320
|
+
return (styleOptions?.cssOptions?.platform ?? styleOptions?.platform) === "lynx" ? transformLynxCssCompat(webCss) : webCss;
|
|
4321
|
+
}
|
|
4233
4322
|
if (!isMiniProgramGeneratorTarget(target)) return css;
|
|
4234
4323
|
return finalizeMiniProgramCss(css, {
|
|
4235
4324
|
cssSelectorReplacement: styleOptions?.cssOptions?.cssSelectorReplacement ?? styleOptions?.cssSelectorReplacement,
|
|
@@ -7634,6 +7723,7 @@ exports.stripMiniProgramCssSpecificityPlaceholders = stripMiniProgramCssSpecific
|
|
|
7634
7723
|
exports.toPosixPath = toPosixPath;
|
|
7635
7724
|
exports.transformCssMacroCss = transformCssMacroCss;
|
|
7636
7725
|
exports.transformCssMacroTailwindV4Source = transformCssMacroTailwindV4Source;
|
|
7726
|
+
exports.transformLynxCssCompat = transformLynxCssCompat;
|
|
7637
7727
|
exports.transformWebCssCompat = transformWebCssCompat;
|
|
7638
7728
|
exports.transformWebCssSafeSelectors = transformWebCssSafeSelectors;
|
|
7639
7729
|
Object.defineProperty(exports, "unitConversionComposeRules", {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { type PostcssAppType, type PostcssStyleBranch, type PostcssStyleBranchProfile, resolvePostcssStyleBranch, type ResolvePostcssStyleBranchOptions, resolvePostcssStyleBranchProfile, } from './branches/index.js';
|
|
2
2
|
export { type DynamicColorMixAlphaProtection, type DynamicColorMixAlphaProtectionOptions, type ModernColorValueNormalization, normalizeModernColorValue, protectDynamicColorMixAlpha, protectDynamicVarFallbacks, } from './compat/color-mix.js';
|
|
3
|
+
export { transformLynxCssCompat } from './compat/lynx-css.js';
|
|
3
4
|
export { consumeCascadeLayers, finalizeMiniProgramCss, hasMiniProgramCssSpecificityPlaceholders, hoistTailwindPreflightBase, normalizeMiniProgramGeneratedCssForPostcss, pruneMiniProgramGeneratedCss, removeEmptyAtRules, removeUnsupportedAtSupports, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, stripMiniProgramCssSpecificityPlaceholders, unwrapUnsupportedCascadeLayers, } from './compat/mini-program-css/index.js';
|
|
4
5
|
export { normalizeMiniProgramPrefixedDeclaration, removeUnsupportedMiniProgramPrefixedAtRule, } from './compat/mini-program-prefixes.js';
|
|
5
6
|
export { convertTailwindcssRpxDeclarationsToRem, convertTailwindcssRpxDeclarationToRem, convertTailwindcssRpxValueToRem, normalizeTailwindcssRpxDeclaration, normalizeTailwindcssRpxDeclarations, normalizeTailwindcssWebRpxDeclarations, type TailwindcssRpxToRemOptions, } from './compat/tailwindcss-rpx.js';
|
package/dist/index.js
CHANGED
|
@@ -1764,8 +1764,8 @@ function resolveNodes(nodes, variables, resolving) {
|
|
|
1764
1764
|
const fallback = commaIndex >= 0 ? valueParser.stringify(node.nodes.slice(commaIndex + 1)).trim() : "";
|
|
1765
1765
|
const configured = variables.get(variable.value);
|
|
1766
1766
|
let replacement;
|
|
1767
|
-
if (configured !== void 0 && !resolving.has(variable.value)) replacement = resolveThemeValue(configured, variables, /* @__PURE__ */ new Set([...resolving, variable.value]));
|
|
1768
|
-
else if (fallback && isTailwindcssV4ThemeVariable(variable.value)) replacement = resolveThemeValue(fallback, variables, resolving);
|
|
1767
|
+
if (configured !== void 0 && !resolving.has(variable.value)) replacement = resolveThemeValue$1(configured, variables, /* @__PURE__ */ new Set([...resolving, variable.value]));
|
|
1768
|
+
else if (fallback && isTailwindcssV4ThemeVariable(variable.value)) replacement = resolveThemeValue$1(fallback, variables, resolving);
|
|
1769
1769
|
if (replacement === void 0) {
|
|
1770
1770
|
resolveNodes(node.nodes, variables, resolving);
|
|
1771
1771
|
continue;
|
|
@@ -1775,7 +1775,7 @@ function resolveNodes(nodes, variables, resolving) {
|
|
|
1775
1775
|
index += replacementNodes.length - 1;
|
|
1776
1776
|
}
|
|
1777
1777
|
}
|
|
1778
|
-
function resolveThemeValue(value, variables, resolving = /* @__PURE__ */ new Set()) {
|
|
1778
|
+
function resolveThemeValue$1(value, variables, resolving = /* @__PURE__ */ new Set()) {
|
|
1779
1779
|
if (!value.includes("var(")) return value;
|
|
1780
1780
|
const parsed = valueParser(value);
|
|
1781
1781
|
resolveNodes(parsed.nodes, variables, resolving);
|
|
@@ -1829,7 +1829,7 @@ function consumeUniAppXSystemRootTheme(root, customPropertyValues) {
|
|
|
1829
1829
|
const carriers = new Set(carrierRules);
|
|
1830
1830
|
root.walkDecls((decl) => {
|
|
1831
1831
|
if (decl.parent?.type === "rule" && carriers.has(decl.parent)) return;
|
|
1832
|
-
decl.value = resolveThemeValue(decl.value, variables);
|
|
1832
|
+
decl.value = resolveThemeValue$1(decl.value, variables);
|
|
1833
1833
|
});
|
|
1834
1834
|
}
|
|
1835
1835
|
splitUnresolvedAuthorVariableFallbacks(root, variables);
|
|
@@ -2103,6 +2103,92 @@ function resolvePostcssStyleBranchProfile(options) {
|
|
|
2103
2103
|
return resolvePostcssFrameworkProfile(options);
|
|
2104
2104
|
}
|
|
2105
2105
|
//#endregion
|
|
2106
|
+
//#region src/compat/lynx-css.ts
|
|
2107
|
+
const tailwindThemePropertyPatterns = [
|
|
2108
|
+
/^--aspect-/,
|
|
2109
|
+
/^--animate-/,
|
|
2110
|
+
/^--blur-/,
|
|
2111
|
+
/^--breakpoint-/,
|
|
2112
|
+
/^--color-/,
|
|
2113
|
+
/^--container-/,
|
|
2114
|
+
/^--drop-shadow-/,
|
|
2115
|
+
/^--ease-/,
|
|
2116
|
+
/^--default-font-/,
|
|
2117
|
+
/^--font-/,
|
|
2118
|
+
/^--font-weight-/,
|
|
2119
|
+
/^--inset-shadow-/,
|
|
2120
|
+
/^--leading-/,
|
|
2121
|
+
/^--perspective-/,
|
|
2122
|
+
/^--radius-/,
|
|
2123
|
+
/^--shadow-/,
|
|
2124
|
+
/^--text-/,
|
|
2125
|
+
/^--tracking-/,
|
|
2126
|
+
/^--spacing$/
|
|
2127
|
+
];
|
|
2128
|
+
function isTailwindThemeProperty(property) {
|
|
2129
|
+
return tailwindThemePropertyPatterns.some((pattern) => pattern.test(property));
|
|
2130
|
+
}
|
|
2131
|
+
function isThemeScopeSelector(selector) {
|
|
2132
|
+
return selector.split(",").some((part) => {
|
|
2133
|
+
const normalized = part.trim();
|
|
2134
|
+
return normalized === ":root" || normalized === ":host";
|
|
2135
|
+
});
|
|
2136
|
+
}
|
|
2137
|
+
function collectTailwindThemeProperties(root) {
|
|
2138
|
+
const values = /* @__PURE__ */ new Map();
|
|
2139
|
+
root.walkRules((rule) => {
|
|
2140
|
+
if (!isThemeScopeSelector(rule.selector)) return;
|
|
2141
|
+
rule.walkDecls((decl) => {
|
|
2142
|
+
if (isTailwindThemeProperty(decl.prop)) values.set(decl.prop, decl.value.trim());
|
|
2143
|
+
});
|
|
2144
|
+
});
|
|
2145
|
+
return values;
|
|
2146
|
+
}
|
|
2147
|
+
function resolveThemeValue(value, properties, resolving = /* @__PURE__ */ new Set()) {
|
|
2148
|
+
if (!value.includes("var(")) return value;
|
|
2149
|
+
const parsed = valueParser(value);
|
|
2150
|
+
parsed.walk((node) => {
|
|
2151
|
+
if (node.type !== "function" || node.value.toLowerCase() !== "var") return;
|
|
2152
|
+
const property = node.nodes.find((child) => child.type === "word" && child.value.startsWith("--"))?.value;
|
|
2153
|
+
if (!property || resolving.has(property)) return;
|
|
2154
|
+
const propertyValue = properties.get(property);
|
|
2155
|
+
if (!propertyValue) return;
|
|
2156
|
+
const nextResolving = new Set(resolving);
|
|
2157
|
+
nextResolving.add(property);
|
|
2158
|
+
const resolved = resolveThemeValue(propertyValue, properties, nextResolving);
|
|
2159
|
+
const mutableNode = node;
|
|
2160
|
+
mutableNode.type = "word";
|
|
2161
|
+
mutableNode.value = resolved;
|
|
2162
|
+
delete mutableNode.nodes;
|
|
2163
|
+
});
|
|
2164
|
+
return parsed.toString();
|
|
2165
|
+
}
|
|
2166
|
+
function removeConsumedThemeProperties(root) {
|
|
2167
|
+
root.walkRules((rule) => {
|
|
2168
|
+
if (!isThemeScopeSelector(rule.selector)) return;
|
|
2169
|
+
rule.walkDecls((decl) => {
|
|
2170
|
+
if (isTailwindThemeProperty(decl.prop)) decl.remove();
|
|
2171
|
+
});
|
|
2172
|
+
if (rule.nodes.length === 0) rule.remove();
|
|
2173
|
+
});
|
|
2174
|
+
}
|
|
2175
|
+
/** 将 Lynx 原生无法继承的 Tailwind theme 变量静态化。 */
|
|
2176
|
+
function transformLynxCssCompat(css) {
|
|
2177
|
+
try {
|
|
2178
|
+
const root = postcss$1.parse(css);
|
|
2179
|
+
const properties = collectTailwindThemeProperties(root);
|
|
2180
|
+
if (properties.size === 0) return css;
|
|
2181
|
+
root.walkDecls((decl) => {
|
|
2182
|
+
decl.value = resolveThemeValue(decl.value, properties);
|
|
2183
|
+
});
|
|
2184
|
+
removeConsumedThemeProperties(root);
|
|
2185
|
+
postcss$1([postcssCalc()]).process(root, { from: void 0 }).sync();
|
|
2186
|
+
return root.toString();
|
|
2187
|
+
} catch {
|
|
2188
|
+
return css;
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
//#endregion
|
|
2106
2192
|
//#region src/compat/mini-program-css/cascade-layers.ts
|
|
2107
2193
|
const LAYER_PATH_SEPARATOR = "";
|
|
2108
2194
|
const LAYER_INSERTION_ANCHOR = "__weapp_tailwindcss_layer_anchor__";
|
|
@@ -4214,7 +4300,10 @@ function isMiniProgramGeneratorTarget(target) {
|
|
|
4214
4300
|
return target !== "web";
|
|
4215
4301
|
}
|
|
4216
4302
|
function finalizeGeneratedCss(css, target, styleOptions, webCompat) {
|
|
4217
|
-
if (target === "web")
|
|
4303
|
+
if (target === "web") {
|
|
4304
|
+
const webCss = transformWebCssCompat(css, webCompat);
|
|
4305
|
+
return (styleOptions?.cssOptions?.platform ?? styleOptions?.platform) === "lynx" ? transformLynxCssCompat(webCss) : webCss;
|
|
4306
|
+
}
|
|
4218
4307
|
if (!isMiniProgramGeneratorTarget(target)) return css;
|
|
4219
4308
|
return finalizeMiniProgramCss(css, {
|
|
4220
4309
|
cssSelectorReplacement: styleOptions?.cssOptions?.cssSelectorReplacement ?? styleOptions?.cssSelectorReplacement,
|
|
@@ -7505,4 +7594,4 @@ function mergeMiniProgramThemeScopeRuleDeclarations(baseCss, css) {
|
|
|
7505
7594
|
}
|
|
7506
7595
|
}
|
|
7507
7596
|
//#endregion
|
|
7508
|
-
export { CSS_MACRO_POSTCSS_PLUGIN_NAME, CSS_MACRO_STYLE_OPTIONS_MARKER, FULL_SOURCE_SCAN_EXTENSIONS, FULL_SOURCE_SCAN_EXTENSION_RE, FULL_SOURCE_SCAN_PATTERN, analyzeTailwindCssDirectives, cleanLocalCssImportWrapperTailwindDirectives, cleanLocalCssImportWrapperTailwindDirectivesRoot, collectApplyOnlyCssSelectors, collectApplyOnlyCssSelectorsRoot, collectCssImportRequestsRoot, collectCssInlineSourceCandidates, compileCssMacroConditionalComments, consumeCascadeLayers, containsCssAfterMinify, convertTailwindcssRpxDeclarationToRem, convertTailwindcssRpxDeclarationsToRem, convertTailwindcssRpxValueToRem, createCssSourceOrderAppend, createFallbackPlaceholderReplacer, createInjectPreflight, createPostcssStyleTargetProfile, createSourceScanPattern, createStyleHandler, createStylePipeline, createTailwindSourceEntryMatcher, createWeappTailwindcssPostcssPlugin, creator as cssMacroPostcssPlugin, dedupeCoveredCssRules, expandInlineSourceCandidatePattern, expandTailwindSourceEntries, filterApplyOnlyGeneratedCss, filterApplyOnlyGeneratedCssRoot, filterExistingCssRules, finalizeMiniProgramCss, getPostcssPluginName, hasCssMacroStyleOptions, hasCssMacroTailwindV4CustomVariantConditionalComments, hasCssMacroTailwindV4Directive, hasCssMacroTailwindV4InternalAtRules, hasCssMacroTailwindV4Source, hasMiniProgramCssSpecificityPlaceholders, hoistTailwindPreflightBase, internalCssSelectorReplacer, isFileExcludedByTailwindSourceEntries, isFileMatchedByTailwindSourceEntries, isLocalCssImportRequest, isMiniProgramLocalCssImportRequest, isPureLocalCssImportWrapper, isPureLocalCssImportWrapperRoot, isTailwindCssGenerationDirective, isTailwindCssImportAtRule, isTailwindCssImportRequest, isTailwindCssPackageJsonImportRequest, isWeappTailwindcssImportRequest, mergeCoveredCssRuleDeclarations, mergeMiniProgramPreflightRuleDeclarations, mergeMiniProgramThemeScopeRuleDeclarations, normalizeLegacyContentEntries, normalizeMiniProgramGeneratedCssForPostcss, normalizeMiniProgramPrefixedDeclaration, normalizeModernColorValue, normalizeOutputImportRequest, normalizeTailwindCssImportRequest, normalizeTailwindcssRpxDeclaration, normalizeTailwindcssRpxDeclarations, normalizeTailwindcssV4InfinityCalcCss, normalizeTailwindcssWebRpxDeclarations, normalizeWebCssCompatOptions, parseConfigParam, parseSourceFileParam, parseTailwindCssConfigRequest, parseTailwindCssDirectiveRequest, postcss, postcssHtmlTransform, prefixLocalCssImportsWithWebpackIgnoreRoot, protectDynamicColorMixAlpha, protectDynamicVarFallbacks, pruneMiniProgramGeneratedCss, removeEmptyAtRules, removeMatchingLocalCssImports, removeMatchingLocalCssImportsRoot, removeTailwindPostcssPlugins, removeTailwindSourceDirectivesRoot, removeUnsupportedAtSupports, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, removeUnsupportedMiniProgramCssImportsRoot, removeUnsupportedMiniProgramPrefixedAtRule, resolveCssSourceEntries, resolveFilteredPostcssConfig, resolvePostcssConfig, resolvePostcssFrameworkProfile, resolvePostcssFrameworkStrategy, resolvePostcssStyleBranch, resolvePostcssStyleBranchProfile, resolvePostcssStyleTarget, resolveSourceScanPath, resolveTailwindSourceEntry, restoreLocalCssImports, rewriteLocalCssImportRequestsForOutput, rewriteLocalCssImportRequestsForOutputRoot, selectorContainsPseudoClass, splitLocalCssImports, splitLocalCssImportsRoot, stripMiniProgramCssSpecificityPlaceholders, toPosixPath, transformCssMacroCss, transformCssMacroTailwindV4Source, transformWebCssCompat, transformWebCssSafeSelectors, unitConversionComposeRules, unitConversionPresets, unwrapUnsupportedCascadeLayers, withCssMacroStyleOptions };
|
|
7597
|
+
export { CSS_MACRO_POSTCSS_PLUGIN_NAME, CSS_MACRO_STYLE_OPTIONS_MARKER, FULL_SOURCE_SCAN_EXTENSIONS, FULL_SOURCE_SCAN_EXTENSION_RE, FULL_SOURCE_SCAN_PATTERN, analyzeTailwindCssDirectives, cleanLocalCssImportWrapperTailwindDirectives, cleanLocalCssImportWrapperTailwindDirectivesRoot, collectApplyOnlyCssSelectors, collectApplyOnlyCssSelectorsRoot, collectCssImportRequestsRoot, collectCssInlineSourceCandidates, compileCssMacroConditionalComments, consumeCascadeLayers, containsCssAfterMinify, convertTailwindcssRpxDeclarationToRem, convertTailwindcssRpxDeclarationsToRem, convertTailwindcssRpxValueToRem, createCssSourceOrderAppend, createFallbackPlaceholderReplacer, createInjectPreflight, createPostcssStyleTargetProfile, createSourceScanPattern, createStyleHandler, createStylePipeline, createTailwindSourceEntryMatcher, createWeappTailwindcssPostcssPlugin, creator as cssMacroPostcssPlugin, dedupeCoveredCssRules, expandInlineSourceCandidatePattern, expandTailwindSourceEntries, filterApplyOnlyGeneratedCss, filterApplyOnlyGeneratedCssRoot, filterExistingCssRules, finalizeMiniProgramCss, getPostcssPluginName, hasCssMacroStyleOptions, hasCssMacroTailwindV4CustomVariantConditionalComments, hasCssMacroTailwindV4Directive, hasCssMacroTailwindV4InternalAtRules, hasCssMacroTailwindV4Source, hasMiniProgramCssSpecificityPlaceholders, hoistTailwindPreflightBase, internalCssSelectorReplacer, isFileExcludedByTailwindSourceEntries, isFileMatchedByTailwindSourceEntries, isLocalCssImportRequest, isMiniProgramLocalCssImportRequest, isPureLocalCssImportWrapper, isPureLocalCssImportWrapperRoot, isTailwindCssGenerationDirective, isTailwindCssImportAtRule, isTailwindCssImportRequest, isTailwindCssPackageJsonImportRequest, isWeappTailwindcssImportRequest, mergeCoveredCssRuleDeclarations, mergeMiniProgramPreflightRuleDeclarations, mergeMiniProgramThemeScopeRuleDeclarations, normalizeLegacyContentEntries, normalizeMiniProgramGeneratedCssForPostcss, normalizeMiniProgramPrefixedDeclaration, normalizeModernColorValue, normalizeOutputImportRequest, normalizeTailwindCssImportRequest, normalizeTailwindcssRpxDeclaration, normalizeTailwindcssRpxDeclarations, normalizeTailwindcssV4InfinityCalcCss, normalizeTailwindcssWebRpxDeclarations, normalizeWebCssCompatOptions, parseConfigParam, parseSourceFileParam, parseTailwindCssConfigRequest, parseTailwindCssDirectiveRequest, postcss, postcssHtmlTransform, prefixLocalCssImportsWithWebpackIgnoreRoot, protectDynamicColorMixAlpha, protectDynamicVarFallbacks, pruneMiniProgramGeneratedCss, removeEmptyAtRules, removeMatchingLocalCssImports, removeMatchingLocalCssImportsRoot, removeTailwindPostcssPlugins, removeTailwindSourceDirectivesRoot, removeUnsupportedAtSupports, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, removeUnsupportedMiniProgramCssImportsRoot, removeUnsupportedMiniProgramPrefixedAtRule, resolveCssSourceEntries, resolveFilteredPostcssConfig, resolvePostcssConfig, resolvePostcssFrameworkProfile, resolvePostcssFrameworkStrategy, resolvePostcssStyleBranch, resolvePostcssStyleBranchProfile, resolvePostcssStyleTarget, resolveSourceScanPath, resolveTailwindSourceEntry, restoreLocalCssImports, rewriteLocalCssImportRequestsForOutput, rewriteLocalCssImportRequestsForOutputRoot, selectorContainsPseudoClass, splitLocalCssImports, splitLocalCssImportsRoot, stripMiniProgramCssSpecificityPlaceholders, toPosixPath, transformCssMacroCss, transformCssMacroTailwindV4Source, transformLynxCssCompat, transformWebCssCompat, transformWebCssSafeSelectors, unitConversionComposeRules, unitConversionPresets, unwrapUnsupportedCascadeLayers, withCssMacroStyleOptions };
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-tailwindcss/postcss",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.2.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "3.2.11",
|
|
5
|
+
"description": "PostCSS transforms that bring Tailwind CSS compatibility to every platform. 将 Tailwind CSS 兼容能力带到全端的 PostCSS 转换工具。",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
"postcss-pxtrans": "^1.0.4",
|
|
81
81
|
"postcss-rem-to-responsive-pixel": "^7.0.5",
|
|
82
82
|
"postcss-rule-unit-converter": "^0.2.3",
|
|
83
|
-
"postcss-selector-parser": "^7.1.
|
|
83
|
+
"postcss-selector-parser": "^7.1.5",
|
|
84
84
|
"postcss-value-parser": "^4.2.0",
|
|
85
|
-
"@weapp-tailwindcss/postcss-calc": "^1.0.
|
|
86
|
-
"@weapp-tailwindcss/shared": "2.0.
|
|
87
|
-
"tailwindcss-config": "2.0.
|
|
85
|
+
"@weapp-tailwindcss/postcss-calc": "^1.0.4",
|
|
86
|
+
"@weapp-tailwindcss/shared": "2.0.2",
|
|
87
|
+
"tailwindcss-config": "2.0.3"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@csstools/postcss-is-pseudo-class": "^6.0.0",
|
package/README.en.md
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# @weapp-tailwindcss/postcss
|
|
2
|
-
|
|
3
|
-
> English | [简体中文](./README.md)
|
|
4
|
-
|
|
5
|
-
This package is the CSS processing core of weapp-tailwindcss. It handles PostCSS AST transforms, selector compatibility, platform differences, and Tailwind output post-processing for mini programs.
|
|
6
|
-
|
|
7
|
-
## Website
|
|
8
|
-
|
|
9
|
-
For setup guides, configuration references, and framework examples, see the [official weapp-tailwindcss documentation](https://tw.icebreaker.top).
|