
kate522andClaude Fable 5
20fde1d652
fix(skeleton): put the widget gutter relief on the skeleton's inner item
小工具(首页挂载的 / 侧栏的)骨架加载占位比真实卡片窄一截:card 布局下
每侧窄 8px,视觉上就是「骨架小了一些」。
小工具的卡片走 skip_wrapper=true,直接挂在 .widget-ajaxpager 上
(src/WidgetSystem/PostRenderer.php),不经过 .posts-row,因此只受小工具
这条独立的负边距链作用:
.widget-ajaxpager margin: -8px
.posts-item.card(真实卡片) margin: 8px ← 卡片自身自带
.post_ajax_loader(外层) margin: 8px ← f61142ee 加的补偿
.posts-item.card(骨架内层) margin: 8px ← 同一条卡片规则
骨架于是拿到 8px(外层 loader)+ 8px(内层卡片)= 16px,而真实卡片只有
8px,内容区每侧少 8px。list 模式没暴露是因为 .posts-item 的 8px 来自
`.widget-main-post.style-list .posts-item`,该规则只覆盖 style-list、
不作用于骨架,外层的 8px 恰好补上 list 卡片应有的一份,刚好对齐。
修法:把水平补偿从外层 .post_ajax_loader 移到骨架内层的 .posts-item /
.posts-mini —— 与真实卡片同一个元素、同一条选择器,于是两者逐像素同宽,
也顺带回答了「补偿链的拥有者是谁」这个一直在打补丁的问题。
- assets/css/main.css、assets/css/frontend/post-card.css:.posts-row 与
.widget-ajaxpager 两条链、桌面 8px 与移动 5px 两组,共 8 处规则改为
内层选择器。
- assets/css/routes/user-home.css:面板归零规则同步改到内层,否则它归零
的是已经失效的外层,旧补偿会重新显形。
- tests/widget-system/asset-ledger-contract.test.cjs:把守卫断言改成内层
选择器,并修正规则匹配以支持选择器组(.posts-item, .posts-mini)。
注释说明为何不能补偿外层。
参考主题 zibll 完全没有 .post_ajax_loader 的 margin 规则;AKSRT 需要它,
是因为骨架多包了一层。定位在内层是与参考主题等价的正确解。
Verification:
- node tests/widget-system/asset-ledger-contract.test.cjs 16/16
- node tests/widget-system/post-visual-contract.test.cjs 22/22
- node tests/widget-system/zibll-modern-widgets-contract.test.cjs 10/10
- node tests/widget-system/lazyload-contract.test.cjs 7/7
- node tests/widget-system/frontend-lifecycle-contract.test.cjs 13/13
- node tests/widget-system/page-display-contract.test.cjs 18/18
- node tests/widget-system/message-center-contract.test.cjs 8/8
- php tools/audit-admin-contracts.php errors=0
- build:public 已重建;旧外层规则在源与产物中均已归零
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-10-04 04:07:19 +08:00
..
2026-09-21 20:53:12 +08:00
2026-09-21 20:53:12 +08:00
2026-09-26 21:43:24 +08:00
2026-10-04 04:07:19 +08:00
2026-09-19 12:54:22 +08:00
2026-09-19 11:34:12 +08:00
2026-09-06 12:59:44 +08:00
2026-09-02 13:03:24 +08:00
2026-09-21 20:53:22 +08:00
2026-09-03 13:59:07 +08:00
2026-09-24 11:04:49 +08:00
2026-09-18 18:38:07 +08:00
2026-08-29 15:50:04 +08:00
2026-09-24 21:13:24 +08:00
2026-08-30 20:38:25 +08:00
2026-09-27 00:37:00 +08:00
2026-09-04 19:52:56 +08:00
2026-09-03 12:44:31 +08:00
2026-09-24 21:30:05 +08:00
2026-09-13 20:02:56 +08:00
2026-09-19 11:46:01 +08:00
2026-09-04 22:53:33 +08:00
2026-09-24 11:04:49 +08:00
2026-09-05 17:32:18 +08:00
2026-09-19 17:06:19 +08:00
2026-09-26 20:44:50 +08:00
2026-09-21 21:31:16 +08:00
2026-09-05 22:28:19 +08:00
2026-10-03 22:22:15 +08:00
2026-08-25 18:22:30 +08:00
2026-08-25 18:11:26 +08:00
2026-08-25 18:34:17 +08:00
2026-09-03 12:44:31 +08:00
2026-09-02 13:03:24 +08:00
2026-09-18 17:34:00 +08:00
2026-09-16 17:24:22 +08:00
2026-09-18 22:14:27 +08:00
2026-08-25 06:58:09 +08:00
2026-09-18 19:01:19 +08:00
2026-09-24 20:40:30 +08:00
2026-10-04 03:04:02 +08:00
2026-09-28 21:27:44 +08:00
2026-09-28 21:58:43 +08:00
2026-09-22 19:53:03 +08:00
2026-09-21 20:53:12 +08:00
2026-09-04 22:53:33 +08:00
2026-09-21 20:53:12 +08:00
2026-09-24 16:13:00 +08:00
2026-09-19 14:49:58 +08:00
2026-09-17 19:04:47 +08:00
2026-08-23 22:09:12 +08:00
2026-09-03 21:33:30 +08:00
2026-09-03 21:33:30 +08:00
2026-09-24 16:13:00 +08:00
2026-09-14 12:53:20 +08:00
2026-09-23 14:30:54 +08:00
2026-10-03 22:22:15 +08:00