Closed amrutadotorg closed 1 week ago
please take a look if you like it then I can update the docs.
for the font
property it will be:
Specifies the font or fonts to be used for text display. This can be a valid font name from Google Fonts (e.g., 'Roboto', 'Open Sans') or a path to a local font file starting with '/'. Multiple fonts can be specified as an array, allowing for flexible typography options.
This actually completely broke SQLPage, because the startsWith
handlebars helper does not exist. I'll fix it, but it is a sign that I really need to add better CI tests.
and @amrutadotorg , you should probably test your changes before proposing them ;)
Thank you, will do that next time.
Pull Request Summary: Enhanced Font Management with Local and Google Fonts
Description
This pull request enhances the font management capabilities by refining the handling of the
font
variable to support both local fonts and Google Fonts seamlessly. It ensures backward compatibility with existing configurations while offering enhanced flexibility in font selection.Key Changes
Unified Font Variable:
font
variable, supporting both single fonts and lists.Local Font Support:
/
.@font-face
rules for each local font in various formats (WOFF2, WOFF, TTF, OTF, EOT, SVG).Google Fonts Integration:
<link>
tags to import specified Google Fonts into the project.CSS Variable Enhancements:
_custom
to the names of local fonts in CSS variables to distinguish them from Google Fonts.Detailed Changes
Font Variable Handling:
font
is always treated as an array, accommodating both single font strings and lists without breaking existing setups.Font Loading Strategy:
/
, distinguishing between local and Google Fonts.Enhanced Flexibility:
Example Usage
Single Font (Backward Compatible):
Multiple Fonts with Local and Google Fonts:
Benefits
Impact
font
will continue to function as expected.This pull request significantly improves font management capabilities, offering users more flexibility and control while maintaining compatibility with existing configurations. It enhances the ability to incorporate both local and Google Fonts seamlessly into projects, ensuring consistent and appealing typography.