diff --git a/.changeset/uni-app-x-local-style-important.md b/.changeset/uni-app-x-local-style-important.md new file mode 100644 index 000000000..58b69a8a7 --- /dev/null +++ b/.changeset/uni-app-x-local-style-important.md @@ -0,0 +1,5 @@ +--- +'weapp-tailwindcss': patch +--- + +修复 uni-app x Web 局部样式中的重要修饰符导致 CSS 编译失败的问题,确保 `!mt-6` 与 `mt-6!` 能生成 Tailwind CSS v4 支持的形式。 diff --git a/e2e/hbuilderx-local/runner.ts b/e2e/hbuilderx-local/runner.ts index 531e3c50f..db27f4b84 100644 --- a/e2e/hbuilderx-local/runner.ts +++ b/e2e/hbuilderx-local/runner.ts @@ -357,7 +357,10 @@ async function assertMiniProgramOutput( ).toBeGreaterThan(0) const runtimeStyleEntry = await resolveMiniProgramRuntimeStyleEntry(outputRoot, item.cssExtensions) expect(runtimeStyleEntry, `${item.name} 无法唯一识别小程序运行时根样式入口`).toBeTruthy() - const css = await readReachableMiniProgramStyles(outputRoot, runtimeStyleEntry!, item.cssExtensions) + // 根入口需要沿导入链验证;分包样式由页面路由加载,不会出现在根入口的导入图中。 + const runtimeCss = await readReachableMiniProgramStyles(outputRoot, runtimeStyleEntry!, item.cssExtensions) + expect(runtimeCss, `${item.name} 根样式入口不可读`).not.toBe('') + const css = (await Promise.all(styleFiles.map(readUtf8))).join('\n') expectContent(css, item.cssContains, item.name) if (item.outputContains) {