2

I'm using LESS for a project and I'm trying to use the saturate() method of the CSS filter property (which takes a decimal or percent as an argument), however I can't get it working because LESS is trying to compile it using its own saturate() method, which takes a color as the argument.

Is there a way I can instruct the LESS compiler to treat the saturate() method as the vanilla CSS version, instead of the LESS version?

1
  • 1
    What Less compiler do you use? The reference one (version 1.5.x and higher) can perfectly distinguish between either form by their parameters (e.g. saturate(#123, 50%); -> built-in function and saturate(50%);-> CSS function). Commented May 1, 2014 at 15:57

2 Answers 2

3

You do it kind of like this:

-webkit-filter: ~"saturate(" 50% ~")";  

Cheers!

Sign up to request clarification or add additional context in comments.

Comments

1

I discovered the solution, I needed to escape both the outer property value as well as the inner expression inside the parentheses.

-webkit-filter: ~"saturate(~"50%")";

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.