Skip to content

Font System Consolidation, Heading Hierarchy Optimization, and Improved Font Fallbacks #1220

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AH-Avalanche
Copy link
Collaborator

Font System Updates

Overview

This PR consolidates all font family declarations into a single source of truth (custom.css), optimizes the heading hierarchy for better content scanning, and implements improved system font fallbacks for better performance and reliability, using Inter as the standard font per the design system.

Key Changes

Font Consolidation

All font face declarations have been centralized in src/css/custom.css:

Improved Font Fallbacks

Enhanced system font stack implementation:

/* Base font with improved system fallbacks */
--font-fallback: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif ;

This solution is harmless and very useful.
It is used by GitHub, Wordpress, Bootstrap, Medium, Ghost, etc.

The main reason for using "system" fonts is performance. Fonts are typically one of the largest/heaviest resources loaded on a website. If we can use a font already available on the user’s machine, we can completely eliminate the need to fetch this resource, making load times noticeably faster.
The beauty of system fonts is that it matches what the current OS uses, so it can be a comfortable look.

  • apple-system targets San Francisco in Safari (on Mac OS X and iOS), and it targets Neue Helvetica and Lucida Grande on older versions of Mac OS X. It properly selects between San Francisco Text and San Francisco Display depending on the text’s size.
  • system-ui represents the default UI font on a given platform.
  • BlinkMacSystemFont is the equivalent for Chrome on Mac OS X.
  • Segoe UI targets Windows and Windows Phone.
  • Roboto targets Android and newer Chrome OS. It is deliberately listed after Segoe UI so that if you’re an Android developer on Windows and have Roboto installed, Segoe UI will be used instead.

Heading Hierarchy Optimization

Improved visual hierarchy with optimized sizes:

h1 {
  font-size: 38px;
  line-height: 44px;
}

h2 {
  font-size: 28px;
  line-height: 40px;
}

h3 {
  font-size: 20px;
  line-height: 24px;
}

Testing Instructions

Font Consistency

  • Verify all text uses Inter font
  • Check for any remaining inline font declarations
  • Test font loading across all pages

Font Fallbacks

  • Test with Inter font disabled
  • Verify system font fallbacks on different platforms
  • Check font rendering across browsers

Heading Hierarchy

  • Verify clear visual distinction between heading levels
  • Check content scanning experience
  • Test responsive behavior of heading sizes

Performance

  • Verify font loading optimization
  • Check for any duplicate font declarations
  • Test page load performance

Review Checklist

  • Verify all font declarations are removed from components
  • Test font fallbacks across different platforms
  • Check heading size hierarchy across all pages
  • Verify content scanning experience
  • Test responsive behavior
  • Check accessibility standards
  • Verify page load performance

…ed Font Fallbacks

Overview
This PR consolidates all font family declarations into a single source of truth (custom.css), optimizes the heading hierarchy for better content scanning, and implements improved system font fallbacks for better performance and reliability, using Inter as the standard font per the design system.
Key Changes
1. Font Consolidation
src/css/custom.css:
Centralized all font face declarations
Removed duplicate font family declarations
Established single source of truth for typography
Apply to custom.css
}
2. Improved Font Fallbacks
Enhanced System Font Stack:
Apply to custom.css
}
Added modern system font stack
Improved cross-platform consistency
Enhanced performance during font loading
3. Heading Hierarchy Optimization
Improved Visual Hierarchy:
Apply to custom.css
}
Increased size difference between h1, h2, and h3
Improved line heights for better readability
Enhanced visual scanning of content structure
4. Font Family Cleanup
Removed font family declarations from:
Individual component files
Inline styles
Component-specific CSS
Theme configuration files
Testing Instructions
Font Consistency:
Verify all text uses Inter font
Check for any remaining inline font declarations
Test font loading across all pages
Font Fallbacks:
Test with Inter font disabled
Verify system font fallbacks on different platforms
Check font rendering across browsers
Heading Hierarchy:
Verify clear visual distinction between heading levels
Check content scanning experience
Test responsive behavior of heading sizes
Performance:
Verify font loading optimization
Check for any duplicate font declarations
Test page load performance
Review Checklist
[ ] Verify all font declarations are removed from components
[ ] Test font fallbacks across different platforms
[ ] Check heading size hierarchy across all pages
[ ] Verify content scanning experience
[ ] Test responsive behavior
[ ] Check accessibility standards
[ ] Verify page load performance
Copy link

netlify bot commented Apr 18, 2025

Deploy Preview for snowplow-docs ready!

Name Link
🔨 Latest commit b6ebf2a
🔍 Latest deploy log https://app.netlify.com/sites/snowplow-docs/deploys/680244d9716c1400087f19ce
😎 Deploy Preview https://deploy-preview-1220--snowplow-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants