问题
Having issues compiling some bootstrap 4 modules (updating from beta3).
While the issue can be solved by setting @charset: 'UTF-8';
on _hover.scss
mixin partial (which is noted as deprecated within the file), why would that be needed considering it should compile out of the box as previous beta versions.
Code in _hover.scss
:
@mixin hover {
&:hover { @content; }
}
@mixin hover-focus {
&:hover,
&:focus {
@content;
}
}
@mixin plain-hover-focus {
&,
&:hover,
&:focus {
@content;
}
}
@mixin hover-focus-active {
&:hover,
&:focus,
&:active {
@content;
}
}
After going through SCSS files can't figure exactly what's wrong, quotes seem ok.
回答1:
After going through it in detail seems to be the -
character on top comments ("iOS-an issue..").
One can replace it for their own -
character and should compile fine (or just add @charset: 'UTF-8';
at the top of the _hover.scss
mixin file).
Issue report: https://github.com/twbs/bootstrap/issues/25391
回答2:
I ran into the same charset problem.
Especially on OSX there seams to be a problem with ruby Encoding Settings.
I fixed it creating a config.rb file in the main project directory to tell ruby explicitly which charset encoding it should use. Since sass and compass depend on ruby, chances good that this will fix your problems.
Encoding.default_external = 'utf-8'
来源:https://stackoverflow.com/questions/48371041/bootstrap-4-scss-compilation-error-invalid-us-ascii-character-xe2