-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Hi,
Im trying to write a neat mixin function for generating ie opacity filters, but I can't get it to come out without quotes.
Essentially, I want to add a var into an e('') string e.g.
filter: e("progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/view/@{css_hi_shared}/cream/hi/shared/img/cbr.png', sizingMethod='crop')");
where @{css_hi_shared} should be replaced with a version e.g. 'trunk'
I have come up with this:
@css_hi_shared: trunk;
@path_pre: "/view/shared/";
@path_post: "/hi/img/";
.filter(@image:'', @sizingMethod:crop) {
@url: %('%s%s%s%s',@path_pre, @css_hi_shared, @path_post, @image);
@filter: e("progid:DXImageTransform.Microsoft.AlphaImageLoader(src='%s', sizingMethod='crop')");
@filtersub: %(@filter, @url);
filter: @filtersub;
}
.filter('cbr.png');
Which returns:
filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/view/shared/trunk/hi/img/cbr.png', sizingMethod='crop')";
not
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/view/shared/trunk/hi/img/cbr.png', sizingMethod='crop');
I have tried a range of permutations and combinations of %() and e() but I can't make it output without the quotes.
Any ideas?
Cheers
Rob