Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Function in mixin - grayscale #134

Open
Maxence opened this issue Oct 24, 2013 · 3 comments
Open

CSS Function in mixin - grayscale #134

Maxence opened this issue Oct 24, 2013 · 3 comments

Comments

@Maxence
Copy link

Maxence commented Oct 24, 2013

Hello,
I'm trying to create a mixin for grayscaling an html element.

In CSS way, it should be :

filter: grayscale(50%);

My mixin :

@mixin grayscale_element($value) {
    -webkit-filter: grayscale($value);
    -moz-filter: grayscale($value);
    filter: grayscale($value);
}

My error :

Fatal error: Uncaught exception 'SassScriptFunctionException' with message 'SassNumber must be a SassColour
Source: -webkit-filter: grayscale($value)'

Problem is, in sass grayscale is already a function, and paramter should be a color.
Module: Sass::Script::Functions - Sass Documentation
http://sass-lang.com/documentation/Sass/Script/Functions.html#grayscale-instance_method

How can I use these filter in a mixin ?

@nick4fake
Copy link

duplicate of #107

@sense-design
Copy link

Hey guys, please try this

filter: unquote("grayscale(100%)")

@LukasMeine
Copy link

I have made a pull request to fix this. Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants