gemini icon indicating copy to clipboard operation
gemini copied to clipboard

Fix css coverage issue if using sass variables

Open LarsHassler opened this issue 8 years ago • 1 comments

Problem

When a sass is used with the following construct

$variable: green;

.selector {
  color: $variable;
}

The parsed css & source map will map the end of rule .selector to the end of the variable declaration instead of the last line. This is due to buggy source maps in both node-sass & ruby-sass. A colleague of mine is already fixing lib-sass, which is the c++ sass compiler which is used by node-sass.

Solution

Since css coverage is only interested in a line/block level coverage the start of the last declaration within the rule will be mapped correctly by the source map. This should also have no effects on just minified css and other pre-compilers like less

LarsHassler avatar Oct 14 '16 18:10 LarsHassler

Hi! Is this problem still actual?

sipayRT avatar Jun 23 '17 13:06 sipayRT