Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Fix css coverage issue if using sass variables #644

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix css coverage issue if using sass variables #644

wants to merge 3 commits into from

Conversation

LarsHassler
Copy link

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

@levonet levonet added the review label Oct 14, 2016
@sipayRT
Copy link
Member

sipayRT commented Jun 23, 2017

Hi! Is this problem still actual?

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

Successfully merging this pull request may close these issues.

None yet

3 participants