新增根 biome.json(v2.5,v2 起原生支持 monorepo,子包自动向上查找):
- formatter: 2 空格缩进、单引号、行宽 100、LF、尾逗号、箭头函数括号
(匹配现有代码风格)
- linter: recommended preset + 项目化裁剪
- useTemplate/useTemplate off(geometry.ts 故意保留字符串拼接,
且测试用精确浮点断言锁定行为)
- noNonNullAssertion off(测试与 DOM 访问里的 ! 是惯用写法)
- noConsole off(4 个 lib 用 console.error/warn 做错误上报)
- CSS 关闭 noDescendingSpecificity/noDuplicateProperties
(手写 CSS 的 fallback 模式)
- useImportType/useNodejsImportProtocol/noUnusedVariables warn
- vcs.useIgnoreFile 自动读 .gitignore;排除 public/target/node_modules/
dist/.dioxus/static + Tailwind 入口 input.css(含 @theme 等 Biome 无法
解析的 at-rules)
首次格式化覆盖 29 个源文件:import 排序、node: 协议、引号/缩进统一,
并修复 index.ts 两处 forEach 回调隐式返回值(useIterableCallbackReturn)。
90 个 vitest 用例全绿,确认无语义改动。
41 lines
1.1 KiB
CSS
41 lines
1.1 KiB
CSS
/* ========== 主题切换圆形展开(View Transitions API) ========== */
|
|
|
|
/* 取消所有 UA 默认的动画和颜色混合 */
|
|
::view-transition-old(root),
|
|
::view-transition-new(root) {
|
|
animation: none;
|
|
mix-blend-mode: normal;
|
|
display: block;
|
|
}
|
|
|
|
/* 无论什么方向,始终让 new (新状态) 在上方,并从小圆扩展覆盖 old */
|
|
::view-transition-old(root) {
|
|
z-index: 1;
|
|
}
|
|
|
|
::view-transition-new(root) {
|
|
z-index: 2;
|
|
animation: tt-expand 0.4s ease-out forwards;
|
|
/* 显式给伪元素加上不透明背景,防止截图透明导致看不到覆盖效果 */
|
|
background: var(--color-paper-theme);
|
|
}
|
|
|
|
/* CSS 变量由 JS 注入到 html style 中 */
|
|
@keyframes tt-expand {
|
|
from {
|
|
clip-path: circle(0px at var(--tt-x) var(--tt-y));
|
|
}
|
|
to {
|
|
clip-path: circle(var(--tt-r) at var(--tt-x) var(--tt-y));
|
|
}
|
|
}
|
|
|
|
/* 在 View Transition 期间强制禁用所有 CSS 过渡,
|
|
确保 VT 回调中 toggle dark class 后截图捕获的是最终颜色。 */
|
|
html.is-theme-transitioning,
|
|
html.is-theme-transitioning *,
|
|
html.is-theme-transitioning *::before,
|
|
html.is-theme-transitioning *::after {
|
|
transition: none;
|
|
}
|