less-compiler icon indicating copy to clipboard operation
less-compiler copied to clipboard

and another one :)

Open tjmcewan opened this issue 7 years ago • 4 comments

Could we maybe have a template.conf flag to disable parsing of plain CSS?

site:14728      -webkit-backdrop-filter: saturate(200%) blur(10px)

ExecuteError ARG_COUNT: Function saturate requires at least 2 args, found 1 

Thanks!

tjmcewan avatar Jan 12 '18 06:01 tjmcewan

LESS has its own saturate function which takes 2 arguments: a color value and a percentage. To bypass this and use CSS saturate you can escape:

#elem {
  color: saturate(#abc, 150%);
  -webkit-backdrop-filter: ~'saturate(200%)' blur(10px)
}

Will output:

#elem {
  color: #7bf;
  -webkit-backdrop-filter: saturate(200%) blur(10px);
}

phensley avatar Jan 12 '18 12:01 phensley

ok. seems like I should just wrap my entire file with ~' '. thanks.

tjmcewan avatar Jan 12 '18 14:01 tjmcewan

@tjmcewan The compiler currently doesn't support passing through uses of the CSS saturate function without escaping. If that function is widely used in your file, escaping every instance could be a bit of a hassle...

Specifying a workaround in template.conf by itself wouldn't completely solve the issue since the compiler is also used to parse and minify plain CSS stylesheets. I'll open a ticket for the application and see if there is a quicker way the LESS bypass in template.conf could be implemented.

phensley avatar Jan 12 '18 16:01 phensley

@phensley any update on this? It would be really great to bypass LESS compilation given the wealth front-end build tooling out there.

adamhake avatar Apr 23 '21 20:04 adamhake