Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String interpolation works differently than in lib sass #718

Closed
joneff opened this issue Jun 10, 2019 · 1 comment
Closed

String interpolation works differently than in lib sass #718

joneff opened this issue Jun 10, 2019 · 1 comment

Comments

@joneff
Copy link

joneff commented Jun 10, 2019

The following yields different output in libsass and dartsass:

$em: 1.2em;
$px: 2px;
$calc: #{$em} + #{$px};

body {
  calc: calc( #{$calc} );
}

Expected result (libsass)

body {
  calc: calc( 1.2em + 2px);
}

Actual result (dartsass)

body {
  calc: calc( 1.2em2px );
}
@nex3
Copy link
Contributor

nex3 commented Jun 11, 2019

LibSass's behavior is outdated. See this compatibility note, as well as sass/sass#1778 and sass/libsass#2714.

Practically, I recommend either storing the calc() wrapper in the variable itself ($calc: calc(#{$em} + #{$px})) or using the unquote() function ($calc: unquote("#{$em} + #{$px}")).

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

No branches or pull requests

2 participants