Skip to content

fix: center Her template sections in WeChat - #32

Merged
windzu merged 1 commit into
mainfrom
codex/fix-her-wechat-centering
Aug 9, 2026
Merged

fix: center Her template sections in WeChat#32
windzu merged 1 commit into
mainfrom
codex/fix-her-wechat-centering

Conversation

@windzu

@windzu windzu commented Aug 9, 2026

Copy link
Copy Markdown
Owner

问题

Her 模板通过左右负 margin 扩展刊头和文末卡片。微信公众号渲染会约束区块宽度,导致负 margin 只产生左移、没有同步扩宽,最终所有居中内容相对正文中心线偏左。

Fixes #31

修改

  • 刊头和文末卡片改为显式 width: 100% 与水平 auto margin,移除横向负 margin 依赖
  • 为正文图片补充水平 auto margin,兼容图片宽度小于容器的情况
  • 增加 Juice 内联结果回归测试,验证最终公众号 HTML 中的居中规则

影响

WindPost 预览和微信公众号草稿中的 Her 刊头、文末卡片及正文图片将使用同一正文中心线。

验证

  • pnpm check
  • 32 tests passed
  • lint、TypeScript/build、production audit、release check 均通过

@windzu
windzu marked this pull request as ready for review August 9, 2026 15:42
@windzu
windzu merged commit fa59618 into main Aug 9, 2026
2 checks passed
@windzu
windzu deleted the codex/fix-her-wechat-centering branch August 9, 2026 15:42
@windzu windzu mentioned this pull request Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Her] 公众号实际预览中刊头文字与文末图片未正确居中

1 participant