vtst / ow

Various Eclipse plugins for web development
http://www.normalesup.org/~simonet/soft/
74 stars 29 forks source link

CSS custom properties #277

Open steph950 opened 4 years ago

steph950 commented 4 years ago

Thanks for your great work.

I don't know if you have still time to work on it, but the CSS custom properties are not validated by the eclipse plugin.

--main-bg-color:@mainBGColor; => the double dashes are not recognized as valid during lexical analysis

var(--main-bg-color) => this is also not recognized as valid

But even if Eclipse considers these to be errors, the code is perfectly compiled by the less compiler.

vobruba-martin commented 3 years ago

I'm using this ugly workaround:

:root {
  -x: ~'0;'
  ~'--main-bg-color:' @mainBGColor ~';'
  ~'--another-custom-property:' @whatever ~';'
  ;
}
body {
  background-color: ~'var(--main-bg-color)';
}
steph950 commented 3 years ago

I'm using this ugly workaround:

:root {
  -x: ~'0;'
  ~'--main-bg-color:' @mainBGColor ~';'
  ~'--another-custom-property:' @whatever ~';'
  ;
}
body {
  background-color: ~'var(--main-bg-color)';
}

Indeed using ~'' does the job, Eclipse doesn't see it as errors ;-) But in this case, wrapping with simple quotes removes the IDE links. When I click on a less variable used anywhere, I love this link leading to the less variable declaration...