Skip to content
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

Add CSS variable to override font for easy theming #6439

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

Conversation

JohnyTheCarrot
Copy link

Changes
This PR adds a couple CSS variables for the user to override in order to add a custom font.
Why not just overwrite it using a custom html rule with a font-family property? There are "typography" elements that manually re-specify the font family, and given that those class names seem to be hash based, they would be subject to change as the CSS would change, assuming I'm right.

Added vars to override:
--jf-font-override
--jf-font-override--ja
--jf-font-override--ko
--jf-font-override--zh-CN
--jf-font-override--zh-TW
--jf-font-override--zh-HK
Each of the per-lang overwrites will fall back to --jf-font-override if not overridden, and --jf-font-override will fall back to Noto Sans if not overriden.

When wanting to use font-family anywhere in the code base, one would reference the --jf-current-font variable to retrieve the current effective font, overridden or not.
A jf prefix has been added to the vars to avoid clashes with user themes.

@JohnyTheCarrot JohnyTheCarrot requested a review from a team as a code owner January 11, 2025 18:41
@jellyfin-bot
Copy link
Collaborator

jellyfin-bot commented Jan 11, 2025

Cloudflare Pages deployment

Latest commit 63d99c3
Status ✅ Deployed!
Preview URL https://37d75fcd.jellyfin-web.pages.dev
Type 🔀 Preview

View build logs

@JohnyTheCarrot
Copy link
Author

Maybe the file wouldn't need to be called fonts.noto.scss anymore? Lmk

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