lesscss how to escape parentheses

238 views Asked by At

I have the following pure CSS rule:

#cboxOverlay{
  background:url(images/overlay.png) repeat 0 0; 
  opacity: 0.9; 
  filter: alpha(opacity = 90);
}

When I compile it with less (lessc) It confuses the alpha(opacity = 90) to be a Less function.
How do I escape alpha(opacity = 90) to be treated as simple CSS?

2

There are 2 answers

0
Alon Eitan On BEST ANSWER

In order to escape strings, you need to wrap it like this ~'<string>', it will make the compiler to output the string as-is.

Change:

filter: alpha(opacity = 90);

To:

filter: ~'alpha(opacity = 90)';
0
Lucas Schäf On

This should work:

#cboxOverlay{
  background:url(images/overlay.png) repeat 0 0; 
  opacity: 0.9; 
  filter: ~"alpha(opacity = 90)";
}

See also: http://lesscss.org/#escaping