LiveSASS doesn't support SASS variables in property names
Reported by
erik.to...@gmail.com,
Feb 22 2017
|
||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 Steps to reproduce the problem: Using LiveSASS with Zurb Foundation 5.x SCSS and node-sass. 1. Successfully setup source mapping in DevTools. 2. Edit a SCSS file, it updates the mapped workplace file. 3. LiveSASS does not update the page because LiveSASS fails to start. What is the expected behavior? LiveSASS should be able to resolve the source mapping even if the CSS property is a SCSS variable. What went wrong? Console outputs the following error: LiveSASS failed to start: http://local.dev/cms/[...]/css/mbs.css.map SourceMap is misaligned: right != #{$opposite-direction} compiled: http://local.dev/cms/[...]/css/mbs.css?:1703:3 source: http://local.dev/cms/sites/all/themes/zurb_foundation/scss/foundation/components/_alert-boxes.scss:92:3 SCSS variable #{$opposite-direction} is a variable set by Foundation in _settings.scss, but because it is used to dynamically set a CSS property name ("left" or "right") LiveSASS fails to resolve the compiled result with the source. Did this work before? N/A Chrome version: 56.0.2924.87 Channel: stable OS Version: OS X 10.12.3 Flash Version: Shockwave Flash 24.0 r0
,
Feb 23 2017
@krajshree: I'll see what I can do.
In the meantime, here's a sample of the actual SASS @mixin from Zurb Foundation that LiveSASS can't resolve a source map for. Note the #{$opposite-direction} variable which is compiled to 'right' in the CSS.
@mixin alert-close {
font-size: $alert-close-font-size;
padding: $alert-close-padding;
line-height: 0;
position: absolute;
top: $alert-close-top;
margin-top: -($alert-close-font-size / 2);
#{$opposite-direction}: $alert-close-position;
color: $alert-close-color;
opacity: $alert-close-opacity;
background: $alert-close-background;
&:hover,
&:focus { opacity: $alert-close-opacity-hover; }
}
,
Feb 24 2017
@krajshree: I created a repo on GitHub that you may clone to reproduce the bug. Go check it out at https://github.com/eriktoyra/devtools-livesass-bug.
,
Feb 24 2017
Ah, indeed - we didn't expect sass variables to be used in property names.
,
Nov 9 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by krajshree@chromium.org
, Feb 23 2017Labels: Needs-Feedback