Squarespace / less-compiler

Less compiler in Java
Apache License 2.0
19 stars 9 forks source link

and another one :) #4

Open tjmcewan opened 6 years ago

tjmcewan commented 6 years ago

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!

phensley commented 6 years ago

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);
}
tjmcewan commented 6 years ago

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

phensley commented 6 years ago

@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.

adamhake commented 3 years ago

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