twbs/bootstrap-sass

libsass miscompiles breadcrumb content

cvrebert opened this issue · 10 comments

Under the environment:

sassc: 3.2.1
libsass: 3.2.4
sass2scss: 1.0.3

the SCSS in question:

content: "#{$breadcrumb-separator}\00a0";

is getting compiled to:

content: "/\\00a0";

which is incorrect.
By comparison, Ruby Sass compiles this code to:

content: "/ ";

which is correct (albeit not ASCII).

This is due to a bug in libsass: sass/libsass#1115

The questions are (a) should bootstrap-sass try to workaround this? (b) if yes, how? (c) if yes, since this only affects libsass, do we make the change in bootstrap-sass, or in upstream Bootstrap?
CC: @twbs/sass

Thanks for looking into this. I am experiencing this issue.

(b) One work around is to define \a00a0 as a variable. Under libsass 3.2.5 this compiles to:

$ echo 'a { $a: "/"; $b: "\00a0"; x: "#{$a}#{$b}" }' | node-sass
@charset "UTF-8";
a {
  x: ""; }

(a) Since the workaround is easy, I'll add it in for the time being.
(c) Not sure whether this should be implemented upstream or here? Any use cases for characters other than  ?


Note that the UTF-8 encoding causes #803 for IE 10/11 when other non-UTF8 CSS files are concatenated incorrectly, though that is something we decided not to deal with.

As this issue is completely libsass-specific, it seems logical to keep it downstream, IMO.

This has been fixed on master and 3.3-stable and will be in the next release.

Can you please update composer module https://packagist.org/packages/twbs/bootstrap-sass to latest version with this fix. now it is only:

$ composer show
installed:
  ...
  twbs/bootstrap-sass                          v3.3.5             bootstrap-sass is a Sass-powered version of Bootstrap, ready to drop right into your Sass powered applications.

@klierik We have yet to ship a new release version since the fix was merged. Please be patient. The Composer package isn't any more outdated than our other packages. Thanks.

@cvrebert Looking at the 3.3.6 milestone for Bootstrap it seems like it won't be ready soon. Any chance you could cut release with this fix before the upstream release?

@glebm @cvrebert Not trying to be a pain in the neck, but it's been 3 months since this has been fixed but there hasn't been a bootstrap release. Could we get bootstrap-sass release?

@realityking Temporary workaround:

.breadcrumb > li + li:before {
    content: "/\00a0";
    color: $breadcrumb-color;
}
furey commented

@xKairu Lifesaver. Thank you.