Fonts are not resolving correctly in Storybook on GitLab Pages
If you visit, e.g., https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/scss-typescale--typefaces and inspect the loaded fonts, you'll see that GitLab Sans and JetBrains Mono are not being used.
This is because they are being fetched from https://gitlab-org.gitlab.io/fonts/GitLabSans.woff2 and https://gitlab-org.gitlab.io/fonts/JetBrainsMono.woff2 respectively, which are not correct.
The should be fetched from https://gitlab-org.gitlab.io/gitlab-ui/fonts/GitLabSans.woff2 and https://gitlab-org.gitlab.io/gitlab-ui/fonts/JetBrainsMono.woff2 respectively.
Possible fixes
- Add/edit some webpack configuration to transform the font URLs.
- Don't copy the font files, but reference them directly (i.e., via
node_modules
)
Edited by Mark Florian