fix(webui): add Noto Sans to global font-family stack for Cyrillic text#8205
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the font configuration by adding 'Outfit' and 'Noto Sans' to the global font stack and refining the CJK fallback list. A review comment suggests replacing a hardcoded font stack in the container layout with the newly defined $body-font-family variable to ensure consistency and reduce duplication.
| body { | ||
| .Outfit { | ||
| font-family: 'Outfit', $cjk-sans-fallback, sans-serif !important; | ||
| font-family: 'Outfit', 'Noto Sans', $cjk-sans-fallback, sans-serif !important; |
There was a problem hiding this comment.
To improve maintainability and ensure consistency across the application, use the $body-font-family variable instead of hardcoding the font stack again. Since the stack defined here is now identical to the global default, referencing the variable prevents future discrepancies if the font stack is updated in _variables.scss.
font-family: $body-font-family !important;References
- Avoid code duplication by refactoring shared logic or values into reusable variables or functions.
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In the
.Outfitclass you now duplicate the same font stack as$body-font-family; consider referencing$body-font-family(or a dedicated$outfit-font-familyvariable) to keep the stack defined in a single place and avoid future divergence. - Since
Noto Sansis now part of the global$body-font-family, it may be worth scanning for any other hardcodedfont-familydeclarations that still reference the old stack so they don’t accidentally bypass the updated fallback behavior.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the `.Outfit` class you now duplicate the same font stack as `$body-font-family`; consider referencing `$body-font-family` (or a dedicated `$outfit-font-family` variable) to keep the stack defined in a single place and avoid future divergence.
- Since `Noto Sans` is now part of the global `$body-font-family`, it may be worth scanning for any other hardcoded `font-family` declarations that still reference the old stack so they don’t accidentally bypass the updated fallback behavior.
## Individual Comments
### Comment 1
<location path="dashboard/src/scss/layout/_container.scss" line_range="83" />
<code_context>
body {
.Outfit {
- font-family: 'Outfit', $cjk-sans-fallback, sans-serif !important;
+ font-family: 'Outfit', 'Noto Sans', $cjk-sans-fallback, sans-serif !important;
}
}
</code_context>
<issue_to_address>
**suggestion:** Reuse the `$body-font-family` variable here to keep font stacks consistent and easier to maintain.
This rule now hardcodes the same stack as `$body-font-family`. Using `font-family: $body-font-family !important;` here will keep `.Outfit` in sync with the global body font and avoid future divergence if the stack changes.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
PR AstrBotDevs#8015 added 'Noto Sans' to the Google Fonts link and CJK fallback list, but the font was placed at the end of $cjk-sans-fallback where browsers never reach it for Cyrillic text. The global $body-font-family also lacked 'Outfit' entirely, causing Vuetify to use CJK fonts as the primary face. Changes: - Remove 'Noto Sans' from the end of $cjk-sans-fallback (it is not a CJK font) - Add 'Outfit' and 'Noto Sans' to $body-font-family before CJK fallbacks - Update .Outfit class in _container.scss to match the new stack This ensures: - Latin text → Outfit - Cyrillic text → Noto Sans (loaded by vite-plugin-webfont-dl) - CJK text → Noto Sans SC / PingFang SC etc. Fixes follow-up to AstrBotDevs#8015.
PR #8015 added 'Noto Sans' to the Google Fonts link and CJK fallback list, but the font was placed at the end of $cjk-sans-fallback where browsers never reach it for Cyrillic text. The global $body-font-family also lacked 'Outfit' entirely, causing Vuetify to use CJK fonts as the primary face.
Changes:
This ensures:
Fixes follow-up to #8015.
Modifications / 改动点
Screenshots or Test Results / 运行截图或测试结果
Verified via browser DevTools → Network → Fonts:
Noto Sansis now loaded alongsideOutfitandNoto Sans SC. Cyrillic text renders correctly withNoto Sansglyphs.Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in
requirements.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Adjust global font-family stacks so Latin text uses Outfit, Cyrillic text uses Noto Sans, and CJK text continues to use appropriate CJK fonts.
Bug Fixes:
Enhancements: