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

Font family fallback support #818

Closed
Tracked by #1267
mikeozornin opened this issue Jun 5, 2022 · 3 comments · Fixed by #1325
Closed
Tracked by #1267

Font family fallback support #818

mikeozornin opened this issue Jun 5, 2022 · 3 comments · Fixed by #1325
Assignees

Comments

@mikeozornin
Copy link

mikeozornin commented Jun 5, 2022

Is your feature request related to a problem? Please describe.
I try to make our ui kit figma tokens friendly and struggled in font-family support.
We use css-like font-family in our production tokens, e.g:

{
    font: {
        family: {
            accent: {
                value: "'TT Positive', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif"
            },
            base: {
                value: "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif"
            },
            monospace: {
                value: "'Roboto Mono', 'Consolas', 'Menlo', 'Monaco', monospace"
            }
        }
    }
}

We have a main font (first) and a fallback fonts just to be sure nothing go wrong if there is a issue with main font.

Figma tokens expect only one font so we are unable to use our web components tokens in sync with Figma Tokens.

Describe the solution you'd like
Some support from Figma Tokens could help. E.g Figma tokens could use only first typeface from whole value and skip other. Something like split by comma and take first item.

E.g.

Value stored in token:
"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif"

Value used in Figma:
Inter

If the value is typed like this: value: "'Segoe UI', 'Inter', Arial we should strip away the ' characters so we can pass over the value to Figma.

@six7
Copy link
Collaborator

six7 commented Jun 5, 2022

We could comma-separate fonts and use only the first one.

That would require that no font has a comma in its name though.

As an alternative we might let users write just like you did, with a single quote surrounding token names.

@swordEdge swordEdge self-assigned this Oct 5, 2022
@six7
Copy link
Collaborator

six7 commented Oct 7, 2022

@swordEdge can you add the linked PR?

@six7
Copy link
Collaborator

six7 commented Oct 24, 2022

This was shipped as part of V123 🎉

@six7 six7 closed this as completed Oct 24, 2022
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 a pull request may close this issue.

3 participants