fontaine
fontaine copied to clipboard
fix: redundant/suboptimal @font-face definitions
đ The bug
When encountering multiple @font-face definitions addressing the same font (according to "src" attribute) defined in CSS with i.e. multiple unicode-ranges and/or font-weights/styles this module outputs the same override for every definition.
đ ī¸ To reproduce
https://stackblitz.com/edit/github-wrgakp-4yzwmm
đ Expected behaviour
Output should either group overrides by "src" attribute eliminating multiplication of CSS or (probably unnecessary) take into account weight/style/unicode-range variations.
âšī¸ Additional context
In the reproduction look at <style type="text/css" data-vite-dev-id="/home/projects/github-wrgakp-4yzwmm/node_modules/.cache/nuxt-google-fonts/css/nuxt-google-fonts.css"> in the <head> section.