Reputation: 43953
In SASS, I have this
background-image:url('/folder/pic.png');
but I want to do something like this
$scope : "folder";
background-image:url('/[$scope]/pic.png');
how can I do this in SASS?
Thanks
Upvotes: 1
Views: 99
Reputation: 2675
background-image:url('/' + $scope + '/pic.png');
or
background-image:url('/#{$scope}/pic.png');
Upvotes: 1
Reputation: 14312
You should be able to do it like this:
background-image:url(/#{$scope}/pic.png);
Upvotes: 2
Reputation: 18659
You're very close - you can use #{$var}
to include variables in strings and other tricky places.
The syntax would be this:
$scope: "folder";
background-image: url('/#{$scope}/pic.png');
Upvotes: 2