mariocasciaro / gulp-concat-css

Concatenates css files, bubbling up import statements (as per the standard), and optionally rebasing urls and inlining local import statements.
MIT License
78 stars 19 forks source link

Keep @charset on top. #42

Open Treora opened 7 years ago

Treora commented 7 years ago

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.