Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix charset handling #447

merged 2 commits into from Dec 14, 2020

Fix charset handling #447

merged 2 commits into from Dec 14, 2020


Copy link

@RyanZim RyanZim commented Dec 12, 2020

OK, this is a slightly naive implementation, but I think it's pretty good. If there's a @charset anywhere in the CSS, move it to the top of the output and apply it to everything. If there are multiple @charsets, compare them. If they're all the same, just use one. If they're different, there's no way we can put all of these in one file, so error out. If you legitimately need to import files with different charsets, you can use the plugins or load option to add logic to convert all your files to a single encoding that matches the entry point.

Also added checks to ensure that @charset comes first, warn the user if this isn't the case.

Technically a breaking change due to adding the error and warning cases.

Attn @SLKnutson

Copy link

This looks right to me 👍

@RyanZim RyanZim merged commit f8c3693 into master Dec 14, 2020
2 checks passed
@RyanZim RyanZim deleted the ryan/charset branch December 14, 2020 19:03
Copy link
Collaborator Author

RyanZim commented Dec 14, 2020

Published in v14.0.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants