Miomir Dancevic
Miomir Dancevic

Reputation: 6852

Sass convert variable to string

I have something like this

$theme: "default";
@import "styles/themes/#{$theme}/main";

But it does not work, maybe in import sass have problem?

Upvotes: 0

Views: 2222

Answers (1)

anderssonola
anderssonola

Reputation: 2195

It's not working according to the Sass @import docs: "Imports may contain #{} interpolation, but only with certain restrictions. It’s not possible to dynamically import a Sass file based on a variable; interpolation is only for CSS imports. As such, it only works with url() imports."

Upvotes: 2

Related Questions