cssweblesslessc

lesscss how to escape parentheses


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?


Solution

  • 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)';