libsass
libsass copied to clipboard
Variable interpolation in @import url()
In my Sass file, I have created a settings file where I can pull in the Google Webfont code and then later, I pull it in with a function to import the webfont.
$google-protocol: "http"; // choose http or https
$google-webfont: "Open+Sans:400italic,700italic,400,700|Oswald"; // pull string after ?family= from step 3
@if $google-protocol == "http" or $google-protocol == "https" {
@import url('#{$google-protocol}://fonts.googleapis.com/css?family=#{$google-webfont}');
}
When using regular Sass, I get the following, which is expected:
@import url("http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700|Oswald");
But, when I am using Libsass, I get the following unexpected results where the variables are not being interpolated:
@import url('#{$google-protocol}://fonts.googleapis.com/css?family=#{$google-webfont}');
I am using CodeKit 2.0.5 with Sass 3.3.7 installed. Thanks for your time.