Currently I have this code (working fine):
$RESOURCE_URL: 'https://res.cloudinary.com/xxx/image/upload';
background-image: url('#{$RESOURCE_URL}/abc.jpg');
Now, I am planning to differentiate the RESOURCE_URL
based on a variable from backend.
I know that scss variables are just a syntactic sugar and they won't exist at runtime. So, I want to replace it with css custom property so that I can change its value at runtime.
Here is the new code with css custom property (not-working):
--resource-url: 'https://res.cloudinary.com/xxx/image/upload';
background-image: url('#{var(--resource-url)}/abc.jpg');
But this is not working. It gives me a compile time error:
Can't resolve './var(--resource-url)/abc.jpg'