The @charset at-rule "must be the first element in the style sheet and not be preceded by any character" (see MDN).
If different files have different charsets, things could get complicated; I have not looked how this is handled currently. If they are all the same, they could be deduplicated, or just left the same: "If several @charset at-rules are defined, only the first one is used".
A quick half-fix would be to keep the @charsets in their places (so the one of the first file is used, the rest is invalid), but insert the @import statements just below the first one, rather than above.
The
@charset
at-rule "must be the first element in the style sheet and not be preceded by any character" (see MDN).If different files have different charsets, things could get complicated; I have not looked how this is handled currently. If they are all the same, they could be deduplicated, or just left the same: "If several
@charset
at-rules are defined, only the first one is used".A quick half-fix would be to keep the
@charset
s in their places (so the one of the first file is used, the rest is invalid), but insert the@import
statements just below the first one, rather than above.