-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fonts): extract fonts to separate stylesheet
Vite automatically base64-encodes and inlines fonts when building in library mode. This leads to pretty big CSS files, while at the same time not all fonts are needed all the time. For this reason I split the fonts into a separate CSS file which will only be copied, not bundled. Fonts are still provided by @digitalservice4germany/angie and will be copied on build. More information: - vitejs/vite#3295 - https://vitejs.dev/config/build-options.html#build-assetsinlinelimit BREAKING CHANGE: Fonts now need to be imported separately, see install instructions in the README for more information.
- Loading branch information
1 parent
1c2adf9
commit 27c2ec8
Showing
6 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
*.tgz | ||
*storybook.log | ||
.idea | ||
.vscode | ||
dist | ||
frontend-license-report.csv | ||
node_modules | ||
public/fonts.css | ||
public/fonts/*.woff | ||
public/fonts/*.woff2 | ||
storybook-static | ||
talisman_report | ||
talisman_report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Fonts are provided by @digitalservicebund/angie. But we need to copy | ||
them here rather than bundling them with the rest of the CSS since | ||
Vite would otherwise base64-encode and inline them in the CSS. Because | ||
we don't need all those fonts, the CSS would be unnecessarily big and | ||
slow. | ||
|
||
Also see: | ||
https://github.com/vitejs/vite/issues/3295#issuecomment-1353409889 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
@import "@digitalservice4germany/angie/fonts.css"; | ||
|
||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |