Skip to content

Add @font-face that combines normal and italic fonts#7

Open
quiple wants to merge 1 commit into
contigen:masterfrom
quiple:master
Open

Add @font-face that combines normal and italic fonts#7
quiple wants to merge 1 commit into
contigen:masterfrom
quiple:master

Conversation

@quiple

@quiple quiple commented Dec 4, 2025

Copy link
Copy Markdown

Currently, if you want to use both normal and italic fonts in your project using this package, you must manually specify each font family.

html {
  font-family: 'Geist-Variable';
}
i {
  font-family: 'Geist-VariableItalic';
}

Resolves the issue by adding a CSS file that merges font families into one.

The exports in package.json are redefined as follows:

  • non.geist (added)
  • non.geist -> non.geist/sans
  • non.geist/italic
  • non.geist/m (added)
  • non.geist/mono
  • non.geist/mono-italic

If there is a better suffix, please update.

Thanks for this package!

@contigen

Copy link
Copy Markdown
Owner

Hi. It's surprising that I am just seeing this today, pardon the very late response; I appreciate the intent/effort.

I say keeping the italic and normal font file separate is the better approach, the developer can pull in the italic font file only when strictly needed; or do you have a use case you are targeting?

You might want to check #1.

Thanks.

@quiple

quiple commented May 19, 2026

Copy link
Copy Markdown
Author

Thank you for checking.

As you can see, by setting font-style: italic; within the same font family, there's no need to manually specify the font family for tags like <i>. It will also correctly render italics across all elements where CSS font-style: italic; is applied.
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-style

This is the default behavior for font services like Google Fonts as well: https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900

Additionally, if you only need to load the italic style, you can still use non.geist/italic.

I understand the need to load each font individually. That is why the goal is to keep the current setup as-is while adding CSS to group both the regular and italic styles under the same font family.

Alternatively, removing "Italic" from the font-family name in the italic @font-face declaration would also solve the issue. However, I chose to add a new CSS instead to avoid any unforeseen side effects.

@contigen

Copy link
Copy Markdown
Owner

Hello. Did you check the possibility of #1 happening?

@contigen

Copy link
Copy Markdown
Owner

I'm occupied for now, I'll test tomorrow

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.

2 participants