Is it possible to use variables to set relative paths in Sass? I've tried to do it but just keep getting errors. In my admin css files I'm trying to avoid writing background(../../img/admin/img.jpg) for any images that need accessing from the css. I've tried writing something like
$admin_img: '../../img/admin';
body {
background: url($admin_img/background.png);
}
This code won't work and keeps saying that it expects ')' but found '.png);'
Is it possible to set the paths using variables and how can it be done? Thanks
I think you need to interpolate the variable:
$admin_img: '../../img/admin';
body {
background: url(#{$admin_img}/background.png);
}