Import instead of link rel
- Dominant language
- Python
- Stars
- 16
- Forks
- 8
- Avg merge
- 6m
- Merged PRs (30d)
- 1
Description
Replace Google Fonts with @import inside for better Gmail compatibility
Problem
Currently, Frappe Letters injects Google Fonts using:
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?...">
This works in browsers, but many email clients ignore or remove <link> elements. In particular, Gmail strips these tags from the email HTML, causing the custom font to fall back to the default font.
Proposed solution
Instead of generating a <link> tag, generate:
<style>
@import url('https://fonts.googleapis.com/css2?...');
Gmail preserves blocks and accepts @import rules, allowing the font to be loaded correctly.
Current output
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?...">
Proposed output
<style>
@import url('https://fonts.googleapis.com/css2?...');
Why this change?
Improves compatibility with Gmail.
Keeps the implementation simple.
Does not change the public API.
Requires only a small change in fonts.py.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in fonts.py and locate the code that generates the Google Fonts link element. Change the generated output to a style block containing the equivalent @import rule, without changing the public API. Verify that the resulting email HTML matches the proposed output and preserves the Google Fonts URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100