Skip to content

Error when using multiple interpolations in nth-child divided with minus and spaces #2346

@Anomeon

Description

@Anomeon

input.scss (same error for sass syntax)

$items: 3;
li {
  &:nth-child(#{$items}n - #{$items}) {
    color: red;
  }
}

libsass 3.5.0.beta.2 and 5cfdd12

Invalid CSS after "li {": expected "}", was "&:nth-child(#{$item" on line 2 at column 5

ruby sass 4.0.0.alpha.1 and 3.4.21

li:nth-child(3n - 3) {
  color: red;
}

version info:

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

without spaces works:

$items: 3;
li {
  &:nth-child(#{$items}n-#{$items}) {
    color: red;
  }
}

libsass 3.5.0.beta.2 and 5cfdd12

li:nth-child(3n-3) {
  color: red;
}

Spec sass/sass-spec#1093

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions