diff --git a/CHANGELOG.md b/CHANGELOG.md index d866f211..4713135a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - `` - fix description and story to point out that `PropertyValueList` need always to be used as wrapper +- BOM issue on compressed stylesheet + - first rule `selector` becomes `BOM:selector` that is valid but will never apply + - we fixed this problem by adding a dummy rule as first rule ### Deprecated diff --git a/src/_bom-workaround.scss b/src/_bom-workaround.scss new file mode 100644 index 00000000..bb47a3c1 --- /dev/null +++ b/src/_bom-workaround.scss @@ -0,0 +1,28 @@ +.bom-problem-workaround-dummy-rule { + /** + * This is a workaround to prevent the loss of the first rule of our compressed CSS. + * + * Sass emits a BOM instead of a `@charset` rule when it creates a compressed + * stylesheet that contains non-ASCII characters. + * Postcss preserves that BOM since v8.5.24, before that it silently dropped it. + * Css-loader does not remove it, although it inlines the CSS into a JS string that + * style-loader writes into a `