csstools / postcss-font-magician

Magically generate all the @font-face rules
Other
1k stars 31 forks source link

This breaks `@import` in Parcel #107

Closed maxnordlund closed 7 months ago

maxnordlund commented 2 years ago

Parcel (and maybe other tools) is very picky where @import rules are allowed, otherwise you get this error message:

🚨 @parcel/transformer-css: @import rules must precede all rules aside from @charset and @layer statements

I tracked down the culprit being this plugin, which prepends @font-face rules to the very top here:

https://github.com/csstools/postcss-font-magician/blob/2587f19bc04bdc7f77e2b542041d63c4f3711596/index.js#L379-L380

Unfortunately I'm not familiar enough to fix it myself, but it would be nice if the @font-face rules where inserted just after the @import rules instead.

romainmenke commented 7 months ago

This has been fixed and released in v4