Skip to content

Variable values beginning with "/" throw an error. #2349

@bryanbraun

Description

@bryanbraun

Hi there. 👋 I just noticed that when I begin a variable's value with / an error is thrown and the sass won't compile. This isn't an issue in ruby sass. It also isn't an issue if the / is in the middle of the value.

input.scss

$path1: assets/images; // no errors thrown
$path2: /images;       // errors thrown
.test {
  background: url(#{$path1}/image.png);
  background: url(#{$path2}/image.png);
}

libsass 3.5.0.beta.2

Error: Invalid CSS after "$path2:": expected expression (e.g. 1px, bold), was "/images;"

ruby sass 3.4.23

.test {
  background: url(assets/images/image.png);
  background: url(/images/image.png); }

version info:

$ node-sass --version
node-sass   4.5.0   (Wrapper)       [JavaScript]
libsass         3.5.0.beta.2   (Sass Compiler) [C/C++]

Spec sass/sass-spec#1092

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions