refactor(ui-deps): 统一组件依赖审计与回归规则

This commit is contained in:
zhanjunhao
2026-11-20 14:11:11 +08:00
parent ccde35d22e
commit 03276c5207
12 changed files with 217 additions and 104 deletions
+1 -3
View File
@@ -3,7 +3,6 @@ import postcss from 'postcss';
// 旧浏览器的级联层(@layer)兜底。
//
// index.css 把 Tailwind 的 base / components / utilities 整体包在原生 @layer 里,
// Semi 的按需样式也由 vitePluginSemi({ cssLayer: true }) 包进 @layer semi。
// @layer 自 Chromium 99 / Firefox 97 / Safari 15.4 才支持;更老的内核(停更的
// Edge、Win10 LTSC 自带 Edge、各类国产壳浏览器)把它当未知 at-rule 连同块内
// 全部规则一起丢弃 —— Tailwind 整体失效,页面只剩无尺寸约束的原图 logo。
@@ -72,8 +71,7 @@ export function flattenCssLayers(sources) {
roots.forEach(assertSupportedShape);
// 层外已有逐字相同的规则时,层内那份不必收:选择器与声明都一样、层外的又加载
// 在后,它在旧浏览器里必然被覆盖。Semi 的 @layer 副本整份属于这种情况
// (index.jsx 另行全量引入了层外的 semi.css),剔掉后兜底表只剩约五分之一。
// 在后,它在旧浏览器里必然被覆盖。
const unlayered = new Set();
for (const root of roots) {
root.each((node) => {