next.js
9966e7e1 - [dev-overlay] fix Geist fonts (#76166)

Commit
1 year ago
[dev-overlay] fix Geist fonts (#76166) ### What? Two issues need to be solved: 1. Font isn't working. Dev overlay uses Geist fonts. Currently does not work if they are not installed in OS. 2. Even if fonts worked, we would be downloading fonts from Google for the dev overlay, which is not ideal for slow internet & users with restricted access to Google. ### Why? **Reason to (1):** Styles defined inside Shadow DOM cannot contain `@font-face`. Custom fonts should be defined in the main container and can be accessed in Shadow DOM. Read this [post](https://robdodson.me/posts/at-font-face-doesnt-work-in-shadow-dom/). ### How? To solve (1), we simply lift the font styles outside the Shadow DOM. To solve (2), we introduce a new dev middleware for the dev-server that serves the font assets & we modify the taskfile to move the woff2 fonts to the dist folder. Closes NDX-834
Author
Parents
Loading