New Atlassian fonts in Forge apps with Custom UI

Hi All,

Is there a way to use the new Atlassian Sans and Atlassian Mono fonts (Typography - Product typefaces and scale - Foundations - Atlassian Design System) in Forge apps using Custom UI? I tried the latest @atlaskit/tokens package but I am unable to make the design tokens referencing the new fonts work. Am I missing something, or are the new fonts not available to Forge apps yet?

Thanks,
Gabor

4 Likes

Yes, I am encountering the same problem. If I point to the Atlassian font woff2 file in my css file, I would need extra permissions which breaks the Runs on Atlassian Badge.

If Atlassian wants Forge App to have a consistent style with Atlassian products, the fonts and other UI elements should be made easily accessible

1 Like

Experiencing the same issue. Agreed - it is kind of ridiculous that including Atlassian’s own fonts and stylesheets makes the forge app “not eligible for the Runs on Atlassian program.”

This issue comes from the fact that both the Forge and Connect theming APIs have not been updated to support all themes. They currently only add the DARK and LIGHT themes to the data-theme attribute on the HTML tag.

If you look at the source of the host application, there are more entries that should be added to that attribute:

data-theme="dark:dark light:light spacing:spacing typography:typography"

In order to get the correct fonts loaded (without having to reference them from external source), you will need to update the data-theme attribute manually upon loading of your app. We created a utility library that helps us setting the right value for the data-theme attribute. It is open source so you can check out how we solved this:

For convenience, we created a React hook and a HOC which we use in our applications.

I hope this helps!

Cheers,

Remie

3 Likes