reactjs / reactjs/react.dev

[Beta] Incorrect font weight

未关闭
#5,443 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
JavaScript
星标
11.8k
派生
7.9k
平均合并
1 天 11 小时
30 天内合并 PR
11

描述

This is the current font weight of paragraphs in the beta docs
image
The computed styles have a font weight of 400 but it is actually 500 because there is no font face for the regular font. there is only a font face for the font of weight 500 and this can be found in index.css that only has the following font faces:

@font-face {
    font-family: 'Source Code Pro';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/Source-Code-Pro-Regular.woff2') format('woff2');
  }

  @font-face {
    font-family: 'Optimistic Display';
    src: url('https://beta.reactjs.org/fonts/Optimistic_Display_W_Lt.woff2')
      format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Optimistic Display';
    src: url('https://beta.reactjs.org/fonts/Optimistic_Display_W_Md.woff2')
      format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Optimistic Display';
    src: url('https://beta.reactjs.org/fonts/Optimistic_Display_W_Bd.woff2')
      format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
  }

The solution would be to add a font face for the regular font because the current font weight for the paragraphs is a bit unreadable.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 index.css 开始,检查 issue 中显示的 Optimistic Display @font-face 声明。添加缺失的 regular 字体,然后验证 beta 文档段落使用预期的 regular 字重,并且在浏览器中更易读。

由索引模型根据 Issue 内容生成。

评估

技术栈
css
领域
documentation, frontend
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。