django-static-precompiler icon indicating copy to clipboard operation
django-static-precompiler copied to clipboard

SCSS variables fail to emit inside CSS calc

Open b9chris opened this issue 4 years ago • 1 comments

body {
  $test: 10px;
  left: calc(100% - $test);
}

Should emit:

body {
  left: calc(100% - 10px);
}

Instead emits:

body {
  left: calc(100% - $test);
}

b9chris avatar May 19 '21 22:05 b9chris

@b9chris

Can you confirm that your snippet works correctly if you compile with with SCSS, without using django-static-precompiler?

Also, what is calc() exactly? My guess is that SCSS doesn't recognize this function and doesn't apply variable substitution.

It tried it with the following snippet and it worked:

body {
  $test: 10px;
  left: 100px - $test;
}

The output is:

body {
  left: 90px;
}

andreyfedoseev avatar Jan 30 '22 14:01 andreyfedoseev