Add Modern Text Rendering Optimizations #366
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Modern Text Rendering Optimizations
Summary
This PR adds three modern CSS properties to the
:rootselector to improve text rendering quality across different browsers and operating systems. These optimizations are commonly used in modern CSS resets and enhance readability without introducing breaking changes.Problem
Modern CSS resets often include text rendering optimizations that improve how fonts are displayed across different browsers and operating systems. Currently, reseter.css lacks these optimizations, which can result in:
Solution
Added three CSS properties to the
:where(:root)selector insrc/components/global.scss:-webkit-font-smoothing: antialiased- Improves text rendering on WebKit browsers (Safari, Chrome, Edge) by enabling subpixel antialiasing-moz-osx-font-smoothing: grayscale- Improves text rendering on Firefox/macOS by using grayscale antialiasing instead of subpixel renderingtext-rendering: optimizeLegibility- Enables better kerning and ligature rendering for improved typographyBefore vs After
Before
After
Testing/Validation
:rootselectorManual Testing Recommendations
Visual Testing: Compare text rendering before and after on:
Cross-browser Testing: Verify no visual regressions in:
Performance: These properties have minimal performance impact and are widely used in production.
Why This PR Should Be Merged
Additional Notes
text-rendering: optimizeLegibilitymay have a slight performance impact on very large documents, but the trade-off for better typography is generally considered worthwhile:rootusing the:where()pseudo-class, maintaining the project's low-specificity approachSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.