Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[CLI] css font-family utilities for ease of use and clarity #9

NathanWalker started this conversation in 2. Archives
Discussion options

A sore spot for quite a long time is trying to get the font-family combination correct for iOS/Android.
For a custom font such as barlow-bold.ttf the css needs to be:

font-family: Barlow, barlow-bold;

Getting this correct is sometimes incredibly frustrating for custom fonts.

Proposal: Potentially add a convenient cli command which prints out exactly what css is needed for any given font:

$ ns font /path/to/barlow-bold.ttf

Here's the CSS to use:

font-family: Barlow, barlow-bold;

Also make sure you place the font inside the `fonts` folder at root of your app.

Benefit: Save ton of time debugging why custom fonts aren't working.

You must be logged in to vote

Replies: 4 comments

This comment was marked as disruptive content.

Comment options

I agree with @NathanaelA since custom fonts are in fonts/ folder - we should just list all fonts in the folder.

$ ns fonts

Found Custom Fonts:
-------------------
barlow-bold.ttf    ->    font-family: Barlow, barlow-bold;
fontawesome.ttf    ->    font-family: FontAwesome, fontawesome;

Though, I guess listing system fonts could also be useful, perhaps with a flag to reduce noise?

You must be logged in to vote
0 replies
Comment options

I like a flag to list all if desired but default would print custom fonts in fonts folder only as long as mentions that’s the output it’s printing by default clearly and mention the flag which can be added to list all maybe / Although listing all is usually runtime related since iOS and Android only upon running can output the full list to my knowledge.

You must be logged in to vote
0 replies
Comment options

Active RFC: #21

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #9 on December 08, 2020 17:41.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.