Skip to content

feat(font): add Vazirmatn font for Persian locale - #277

Open
naazeri wants to merge 1 commit into
nohello-net:mainfrom
naazeri:feat/persian-font-vazirmatn
Open

naazeri wants to merge 1 commit into
nohello-net:mainfrom
naazeri:feat/persian-font-vazirmatn

Conversation

@naazeri

@naazeri naazeri commented Sep 16, 2026 •

Copy link
Copy Markdown

Description

This PR introduces the Vazirmatn font from Google Fonts specifically for the Persian (fa) locale.

Why?

The site's default font stack relies on Lato, which does not contain Persian glyphs. Consequently, browsers fall back to arbitrary operating system fonts (such as Times or Tahoma), resulting in inconsistent and sub-optimal typography on Persian pages.

Implementation Details

  • Zero impact on other locales: Vazirmatn is loaded conditionally inside _layout.njk only when lang == 'fa'. Users viewing English or other language versions do not download or connect to Google Fonts for Vazirmatn.
  • Performance optimized: Uses preconnect for fonts.googleapis.com and fonts.gstatic.com, along with display=swap to avoid invisible text flashing (FOIT).
  • Scoped CSS: Applied via html[lang='fa'] in styles.css.

Before
before_hero

After
after_hero

Conditionally load Vazirmatn from Google Fonts when lang is 'fa' and apply it scoped to the Persian locale in CSS.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant