Skip to content

[WIP] Fix alignment issue of Google search box#2

Merged
LR1933 merged 1 commit intomainfrom
copilot/fix-google-search-alignment
Feb 26, 2026
Merged

[WIP] Fix alignment issue of Google search box#2
LR1933 merged 1 commit intomainfrom
copilot/fix-google-search-alignment

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 26, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt

问题描述

页面布局中,顶部 Hero(logo)行和 Navbar 行已经通过 width: 80% / padding-left: 10% 对齐,但 Google 搜索框(message 区域)卡片区(#main-section 没有与上方对齐。

根本原因:config.ymlmessage.content 中,.google-search-container 使用了 transform: scale(1.5) 配合 transform-origin: center toptransform 不影响文档流占位,放大后以"中心"为锚点,导致视觉上搜索框偏离 80% 左对齐基准,与 navbar/logo 产生错位。


需要做的修改

1. 修改 assets/config.yml

message.content<style> 块中,将 .google-search-containertransform-origincenter top 改为 left top

修改前:

.google-search-container {
  transform: scale(1.5);
  transform-origin: center top;
  margin-top: 80px;
  margin-bottom: 120px;
}

修改后:

.google-search-container {
  transform: scale(1.5);
  transform-origin: left top;
  margin-top: 80px;
  margin-bottom: 120px;
}

2. 修改 assets/custom.css

在第 4 节(Section 容器居中)之后,增加以下规则,明确指定搜索容器的 transform-origin(作为 CSS 文件侧的兜底保障):

/* ★ 修复:搜索框因 transform:scale(1.5) 导致视觉偏移
   transform-origin 改为 left top,使放大后左边缘与 navbar 对齐 */
#app section.section > .container .google-search-container {
    transform-origin: left top !important;
}

预期效果

修改后,Google 搜索框放大时以左边缘为锚点缩放,与上方 navbar 链接和 logo 的左边缘保持在同一 80% 宽度基准线上,实现全页面统一左对齐。

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@LR1933 LR1933 marked this pull request as ready for review February 26, 2026 09:10
@LR1933 LR1933 merged commit 5960918 into main Feb 26, 2026
1 check failed
Copilot stopped work on behalf of LR1933 due to an error February 26, 2026 09:10
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.

2 participants