fontaine icon indicating copy to clipboard operation
fontaine copied to clipboard

fix: redundant/suboptimal @font-face definitions

Open PawelDmochowski opened this issue 2 years ago â€ĸ 0 comments

🐛 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.

image

đŸ› ī¸ 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.

PawelDmochowski avatar May 17 '23 10:05 PawelDmochowski