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

support colliding CSS filter effects functions #467

Closed
wants to merge 1 commit into from

Conversation

benesch
Copy link
Contributor

@benesch benesch commented Aug 13, 2014

CSS filter effects (0) define several functions (invert, grayscale,
opacity, saturation) that collide with the names of built-in Sass
functions. Overload these functions with a no-op when the filter effects
function signature is discovered. This is compatible with Ruby Sass.

For example, calling invert with a color will return an inverted color
as before:

color: invert(#333) => color: #cccccc

But calling invert with a percentage will pass through the function
call unharmed.

filter: invert(30%) => filter: invert(30%)
filter: invert(.03) => filter: invert(.03)

Fixes #151.

(0): http://www.w3.org/TR/filter-effects/

CSS filter effects [0] define several functions (invert, grayscale,
opacity, saturation) that collide with the names of built-in Sass
functions. Overload these functions with a no-op when the filter effects
function signature is discovered. This is compatible with Ruby Sass.

For example, calling `invert` with a color will return an inverted color
as before:

    color: invert(sass#333) => color: #cccccc

But calling `invert` with a percentage will pass through the function
call unharmed.

    filter: invert(30%) => filter: invert(30%)
    filter: invert(.03) => filter: invert(.03)

Fixes sass#151.

[0]: http://www.w3.org/TR/filter-effects/
@am11
Copy link
Contributor

am11 commented Aug 14, 2014

Perfect! Thanks 👍

@HamptonMakes
Copy link
Member

This seems to conflict with the work @iamcarrico did on his patch #456, which only focused on invert(). This does address alpha() and grayscale()
I was able to merge them together, however the specs break for alpha().
If you can please rebase off master and run the test suite with ./script/spec then I'd love to be able to fix this issue!

xzyfer pushed a commit to xzyfer/sass-spec that referenced this pull request Oct 6, 2014
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

Successfully merging this pull request may close these issues.

New CSS filter functions conflict with built-in Sass functions
3 participants