Skip to content

IE Filter with variable in path #274

@ghost

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions