Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 优化了一下文档样式,更紧凑清晰 #3105

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

xiaoyatong
Copy link
Collaborator

@xiaoyatong xiaoyatong commented Mar 20, 2025

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fork仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

  • 新功能

    • 在贡献展示区域新增提示板块,为用户提供额外的导航链接。
  • 样式调整

    • 优化了代码块和高亮区域的字体大小、行间距、圆角和边框,呈现更紧凑清晰的视觉效果。
    • 调整了文本、标题、段落、表格和列表的字体权重、行距及内边距,提升整体排版协调性。
    • 统一优化了文档区域和导航栏的边距和尺寸,改善页面布局。

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link

coderabbitai bot commented Mar 20, 2025

Walkthrough

本次变更主要集中于样式调整,影响了代码高亮、Markdown 样式、文档页面与导航组件的布局与排版。具体包括调整字体大小、行高、边框与内外边距的数值;部分组件由内联样式改为使用 CSS 类;以及移除冗余代码行。所有变更均未修改公开暴露的实体声明。

Changes

文件路径 变更摘要
src/sites/assets/styles/highlight.scss 调整 code.hljs 样式:字体大小、行高、圆角、添加边框;移除 padding 和背景样式。
src/sites/assets/styles/md-style.scss 统一调整标题、段落、表格及列表的字体粗细、行高与内边距。
src/sites/.../App.scss(doc-taro、doc 及 theme) 修改文档页面布局:将 margin-left.fixed 宽度从 290px 改为 270px;删除注释代码。
src/sites/sites-react/doc/components/contribution/*.scss 新增贡献组件样式,定义 .qa-container.qa-list.qa-list-item.version-tag.qa-tips 及其子类。
src/sites/sites-react/doc/components/contribution/contribution.tsx 替换内联样式为 CSS 类,新增 qa-tips 部分以展示更多链接。
src/sites/sites-react/doc/components/demoblock/codeblock.tsx 移除构造文档路径的无效代码(删除了 const path = ${ctx.path}/doc.md`` 这一行)。
src/sites/sites-react/doc/components/nav/nav.scss 调整导航栏样式:宽度由 290px 改为 270px,列表项高度、行高、字体权重及伪元素偏移做出相应修改。
src/sites/sites-react/doc/components/nav/nav.tsx 修改导航链接空格数量,由两个   减少为一个。
src/sites/theme/components/nav/nav.scss 修改导航组件样式:导航宽度从 290px 变为 270px,同时调整列表项高度和行高。

Suggested reviewers

  • oasis-cloud

Poem

我是快乐的小兔子,
跳跃在代码的草原上;
CSS 的数字轻轻变,
布局、边框齐整欢;
让我们蹦蹦跳跳迎新篇 🐇🌸
修改之后皆欢笑,代码更舒畅!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9ada0f8 and e7a983a.

📒 Files selected for processing (11)
  • src/sites/assets/styles/highlight.scss (1 hunks)
  • src/sites/assets/styles/md-style.scss (4 hunks)
  • src/sites/sites-react/doc-taro/App.scss (2 hunks)
  • src/sites/sites-react/doc/App.scss (2 hunks)
  • src/sites/sites-react/doc/components/contribution/contribution.scss (1 hunks)
  • src/sites/sites-react/doc/components/contribution/contribution.tsx (3 hunks)
  • src/sites/sites-react/doc/components/demoblock/codeblock.tsx (0 hunks)
  • src/sites/sites-react/doc/components/nav/nav.scss (4 hunks)
  • src/sites/sites-react/doc/components/nav/nav.tsx (1 hunks)
  • src/sites/theme/App.scss (2 hunks)
  • src/sites/theme/components/nav/nav.scss (2 hunks)
💤 Files with no reviewable changes (1)
  • src/sites/sites-react/doc/components/demoblock/codeblock.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test
🔇 Additional comments (25)
src/sites/sites-react/doc/components/nav/nav.tsx (1)

89-90: 优化视觉间距: 此处将 {cp.name} 后的   数量由原来的多个减为一个,能够使导航链接的间距更加紧凑,符合整体文档样式优化的要求。

src/sites/theme/components/nav/nav.scss (2)

9-9: 导航栏宽度调整: 将导航栏宽度由原来的290px调整为270px,使整体页面布局更紧凑,视觉效果更协调。


34-35: 列表项高度调整: 将列表项的高度和行高设置为32px,有助于减少多余空间,从而实现更精炼的导航栏样式。

src/sites/theme/App.scss (2)

35-42: 固定标题宽度更新:.doc-title-position.fixed 区块中,将宽度计算更新为 calc(100% - 270px),以匹配导航栏宽度的调整,确保整体布局风格一致。


54-55: 内容区边距调整:.doc-contentmargin-left 从290px调整为270px,保证内容区域与导航栏保持一致,提升页面排版的整体性。

src/sites/sites-react/doc-taro/App.scss (2)

5-8: 文档内容区边距更新: 修改 .doc-content 中的 margin-left 为270px,与导航栏宽度的调整一致,确保整体文档的布局协调紧凑。


166-170: 固定标题宽度更新: 在固定定位标题部分,将宽度计算调整为 calc(100% - 270px),确保标题区域与其他页面部分保持风格统一。

src/sites/sites-react/doc/components/contribution/contribution.scss (1)

1-30: 新贡献组件样式: 新增的 .qa-container 及其子类的样式定义清晰,包含了边距、边框、字体等属性,能够较好地展示贡献组件信息,同时符合文档风格优化使页面更紧凑清晰的目标。

src/sites/sites-react/doc/App.scss (2)

5-5: 布局边距调整合理

将文档内容区域的左边距从 290px 减少到 270px,有效利用了更多的屏幕空间,使文档内容显示更加宽敞。


166-166: 固定标题宽度调整与左边距变化一致

将固定标题区域的宽度计算从 calc(100% - 290px) 调整为 calc(100% - 270px),与之前的左边距调整保持一致,确保了布局的协调性。

src/sites/sites-react/doc/components/nav/nav.scss (4)

9-9: 导航栏宽度调整与主布局一致

将导航栏宽度从 290px 减少到 270px,与 App.scss 中的边距调整保持一致,确保了整体布局的协调性。


36-38: 导航项更加紧凑,提升阅读效率

导航项的高度和行高从 48px 调整为 40px,同时将字体粗细从 bold 改为 600,使导航菜单更加紧凑且易于浏览,减少了不必要的空白区域。

Also applies to: 41-41


50-50: 活动指示器位置优化

将活动导航项的指示器位置从 left: 0 调整为 left: -12px,使指示器位置更加协调,提升了视觉效果。


64-67: 子菜单项样式优化

子菜单项的内边距从 29px 减少到 12px,高度和行高调整为 36px,字体粗细从 bold 改为 500,使层级结构更加清晰,同时保持了紧凑的视觉效果。

Also applies to: 69-69

src/sites/assets/styles/md-style.scss (5)

45-45: 标题字重调整更符合可读性标准

将标题的字体粗细从 bold 调整为 600,使标题文字在保持足够醒目的同时不过于沉重,提高了长时间阅读的舒适度。


99-99: 段落行高优化

将段落的行高从固定值 22px 调整为相对值 2,使段落在不同字体大小下都能保持良好的行间距,提升了文本的可读性。


111-111: 表格间距优化

表格外边距和单元格内边距的调整使表格更加紧凑,同时仍然保持了良好的数据可读性,有效减少了文档的冗余空间。

Also applies to: 119-119, 131-132


137-137: 表格首列字重增强

将表格首列的字体粗细设置为 600,突出了表格的键名列,使表格的层次结构更加清晰。


169-172: 列表项样式调整

列表项的内边距、字体大小和行高调整使列表更加紧凑且易于阅读,与文档整体风格保持一致。

src/sites/assets/styles/highlight.scss (2)

8-11: 代码块样式优化

代码块的字体大小调整为 13px,行高改为 1.8,使代码显示更加紧凑;边框半径减小为 4px 并添加了 1px 的边框,使代码块外观更加现代化且与整体设计风格协调。这些变更提高了代码的可读性和美观度。

Also applies to: 15-16


31-34: 移除冗余样式属性

移除了 .hljs 选择器中的 padding 和 background 属性,避免了样式冲突,使代码高亮效果更加一致。

src/sites/sites-react/doc/components/contribution/contribution.tsx (4)

3-3: 引入外部样式表

添加 contribution.scss 样式表的引入,将内联样式迁移到外部样式表中,符合关注点分离的最佳实践。


16-18: 使用类名替代内联样式

将之前使用的内联样式改为使用类名(qa-container、qa-list、qa-list-item),提高了代码的可维护性和样式的一致性。

Also applies to: 22-22, 29-33


43-45: 版本标签样式优化

为版本标签添加了 version-tag 类,使版本信息的展示更加规范和一致。


49-65: 增加辅助导航区域

新增了查看更多 issues 和 releases 的链接区域,通过 qa-tips 和 qa-tips-link 类进行样式控制,提升了用户体验,方便用户查找更多相关内容。

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sorry, something went wrong.

@github-actions github-actions bot added action:review This PR needs more reviews (less than 2 approvals) 3.x Target branch 3.x labels Mar 20, 2025
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.49%. Comparing base (9ada0f8) to head (e7a983a).
Report is 1 commits behind head on feat_v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #3105   +/-   ##
==========================================
  Coverage      86.49%   86.49%           
==========================================
  Files            280      280           
  Lines          18492    18492           
  Branches        2775     2774    -1     
==========================================
  Hits           15994    15994           
  Misses          2493     2493           
  Partials           5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants