Skip to content

fix(resume): 用 justify-content/float 替代 flex margin-left:auto,修复新版 WeasyPrint 右对齐失效#35

Open
Rand01ph wants to merge 1 commit into
tw93:mainfrom
Rand01ph:fix/weasyprint-flex-right-align
Open

fix(resume): 用 justify-content/float 替代 flex margin-left:auto,修复新版 WeasyPrint 右对齐失效#35
Rand01ph wants to merge 1 commit into
tw93:mainfrom
Rand01ph:fix/weasyprint-flex-right-align

Conversation

@Rand01ph

Copy link
Copy Markdown

背景

#34.proj-role.section-title .sub 依赖 flex margin-left:auto 右对齐;当前 WeasyPrint(63.1)不支持 flex auto margin,导致角色标签与章节副标题挤在行中(仓库自带 demo 的参考渲染是正确的,详见 issue 截图对比)。

改动(仅 CSS,3 个模板)

resume.html / resume-en.html / resume-ko.html

  • .section-titlejustify-content: space-between.sub 去掉 margin-left:auto
  • .proj-headflexblock.proj-rolemargin-left:autofloat:right.proj-kindmargin-left:1.5mm 以保留与项目名的间距

兼容性

justify-content:space-betweenfloat:right 在所有 WeasyPrint 版本与主流浏览器都支持,旧版渲染不受影响。

验证

用 WeasyPrint 63.1 渲染 resume.html.proj-role.section-title .sub 恢复右对齐。仅 CSS 改动,不动内容与结构。

注:issue 中的「问题 2(CJK 字体在预览被替换)」属 WeasyPrint 层面,不在本 PR 范围。

🤖 Generated with Claude Code

…rgin auto

WeasyPrint 63.1 ignores flex auto-margins, so `.proj-role` and
`.section-title .sub` no longer get pushed to the right edge and end up
mid-line. kami's shipped demo renders are correct, so a recent WeasyPrint
version changed this behavior.

Use `justify-content: space-between` for the section sub and `float: right`
for the role tag (proj-head becomes block; proj-kind keeps its gap via a
small margin). Both techniques render identically across WeasyPrint
versions and browsers.

Affects resume.html, resume-en.html, resume-ko.html — CSS only, no content
or structure change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

@Rand01ph is attempting to deploy a commit to the Tw93 Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant