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

Sourcemaps break when output set to compressed and variable interpolation #2319

Closed
JoshMoreno opened this issue Feb 5, 2017 · 0 comments
Closed

Comments

@JoshMoreno
Copy link

JoshMoreno commented Feb 5, 2017

Setup:

sassc: 3.4.1
libsass: 3.4.3
sass2scss: 1.1.0
sass: 3.4

Bug

I found this bug from compiling bootstrap. It's located in _breadcrumbs.scss - https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/_breadcrumbs.scss

I simplified/isolated the code for debugging. Note that In their original code they linked to - #1115

$breadcrumb-separator: "/" !default;
$nbsp: "\00a0";

.bug {
    content: "#{$breadcrumb-separator}#{$nbsp}"; // Unicode space added since inline-block means non-collapsing white-space
}

The desired result is

.bug { content: "/\00a0"; }

But all the output styles (nested, expanded, compact, compressed) return

.bug { content: "/ "; }

Sourcemaps Issue

On top of that the main issue (for me at least) is that when the output style is set to compressed then source maps become inaccurate. They get created, but the point to wrong files/wrong lines.

I attached a simple demo project to illustrate the bug.

Demo Project

libsass-bug.zip

In the project open the index.html file and inspect the #footer. You'll see the sourcemap pointing to the _header.scss instead of the _footer.scss. If you compile using a different output style this problem goes away, but as I mentioned above, the output for the .bug content property is constant regardless of the output style.

I hope that's enough info. If you need something else, let me know!

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

No branches or pull requests

2 participants