Skip to content

Fix the font-face file importΒ #6187

@oliverschuerch

Description

@oliverschuerch

In our styles package, we define the file src/components/fonts.scss. the file contains the @font-face declarations which point to our CDN https://fonts.post.ch.

Ironically, this file is not imported into src/components/index.scss, which would be logical since it lives in this folder, but instead, it's imported in src/elements/body.scss.

In projects that like to host the fonts themselves, this results in both the declaration for the self-hosted fonts and the globally valid one from the design system ending up in the output, since the body file import is mandatory.

So we should change the following:

  • import src/components/fonts.scss in src/components/index.scss.
  • remove @use '../components/fonts'; from src/elements/body.scss.

This way, the design system specific @font-face declarations stay in the bundle files (post-default.{scss|css}, cargo-default.{scss|css}, etc.), but are not automatically included, when projects import only specific files.

Metadata

Metadata

Labels

v10🐞 bugSomething isn't workingπŸ“¦ stylesRelated to the @swisspost/design-system-styles package

Type

Projects

Status

πŸš€ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions