|
| 1 | +--- |
| 2 | +title: 'Effortlessly optimize web fonts with fontless.' |
| 3 | +authors: |
| 4 | + - 'Giorgio Boa' |
| 5 | +tags: ['Web development', 'Fontaine', 'Qwik'] |
| 6 | +date: 'August 26, 2025' |
| 7 | +canonical: 'https://qwik.dev/blog/fontless' |
| 8 | +--- |
| 9 | + |
| 10 | +import { ArticleBlock } from '~/routes/(blog)/blog/components/mdx/article-block'; |
| 11 | +import { Image } from 'qwik-image'; |
| 12 | +import firstMeeting from './first-meeting.webp'; |
| 13 | +import secondMeeting from './second-meeting.webp'; |
| 14 | + |
| 15 | +<ArticleBlock> |
| 16 | + |
| 17 | +<br/> |
| 18 | +<br/> |
| 19 | + |
| 20 | +## Zero-runtime CSS solution |
| 21 | + |
| 22 | +Zero-runtime CSS solution for Google Fonts, Bunny Fonts, and more. Reduce CLS and boost performance.<br/> |
| 23 | +Some time ago, we came across an impressive library called [Fontaine](https://github.com/unjs/fontaine), created and maintained by the talented [Daniel Roe](https://github.com/danielroe). |
| 24 | + |
| 25 | +The idea behind the library is to optimize the way [Nuxt](https://nuxt.com/) developers use fonts by providing a similar native font while the font files are being downloaded, |
| 26 | +so when the switch to the actual font happens - the “glitch” will be minimal, and by that reducing the bad CLS score on google core web vitals. |
| 27 | + |
| 28 | +Out of curiosity, we attempted to integrate it into a Qwik project and noticed there could be an opportunity to make it framework agnostic. |
| 29 | + |
| 30 | +> After diving into the source code, we figured out pretty quickly that the core of the library is generic enough and can be adopted by all the frameworks powered by [Vite](https://vite.dev/). |
| 31 | +
|
| 32 | +Motivated by this idea, we decided to join forces - the Nuxt and Qwik teams and to create an open-source library as a Vite plugin that will benefit all frameworks. |
| 33 | + |
| 34 | +<br/> |
| 35 | +<Image class="mx-auto" src={firstMeeting} alt="First meeting between NUXT and QWIK ❤️" /> |
| 36 | +<br/> |
| 37 | + |
| 38 | +Daniel Roe was super generous to provide the product of his hard work and to extract it into a generic mutual core and we had a wonderful time collaborating with him for the good of the JavaScript community. |
| 39 | + |
| 40 | +After a few weeks of hard work, [Damian Pumar](https://github.com/damianpumar) had the solution up and running in his local machine.<br/> |
| 41 | +It was incredible to see how smooth the integration is with pretty much all the frameworks.<br/> |
| 42 | + |
| 43 | +<br/> |
| 44 | +<Image class="mx-auto" src={secondMeeting} alt="Second meeting between NUXT and QWIK 🍰" /> |
| 45 | +<br/> |
| 46 | + |
| 47 | +We'd like to thank Daniel Roe, the Nuxt team and the [unjs](https://unjs.io/) project for helping us make this vision of making this brilliant work of Daniel on font optimization available for all frameworks. |
| 48 | + |
| 49 | +This is a great example of how the shared vision of “automatic optimization” for the web comes into fruition. |
| 50 | + |
| 51 | +Automatic font optimization? Yes, please! Say goodbye to CLS issues with Fontless. [Install it now](https://www.npmjs.com/package/fontless)! |
| 52 | + |
| 53 | +</ArticleBlock> |
0 commit comments