1

I get the following error when I gulp:

Error in plugin 'gulp-less'
Message:
    Could not parse alpha in file C:\***\vendor\jquery-ui\jquery-ui.css line no. 1307

Details:
    type: Syntax
    filename: C:\***\vendor\jquery-ui\jquery-ui.css
    index: 37202
    line: 1307
    callLine: NaN
    callExtract: undefined
    column: 23
    extract:    opacity: .003;, filter: Alpha(Opacity=.3); /* support: IE8 */,}
    lineNumber: 1307
    fileName: C:\***\vendor\jquery-ui\jquery-ui.css

I use the complete jQuery UI in v1.12.1 and gulp-less in v3.3.0.

The problem is clear to me, but I couldn't come up with a proper solution. I searched Stack Overflow but I couldn't find a similar problem (nor answer). I assume this cannot be solved easily. Of course, I do not want to modify the line in the jquery-ui.css file, and updating gulp-less is also not an option in my case. But is there a way to configure gulp-less to handle this somehow? Any hint what I could try is appreciated.

jasie
  • 2,192
  • 10
  • 39
  • 54
  • 1
    Have you tried escaping the line, so Less doesn't try to interpret it? i.e `filter: ~"Alpha(Opacity=.3);" ` – Derek Nguyen Jan 29 '19 at 06:18
  • 1
    That would probably work, thanks, but as I wrote: I don't consider it a clean option to modify 3rd party source. – jasie Jan 29 '19 at 08:51
  • Urg my bad, I read that and then forgot about it. How about writing a small preprocessor plugin that replaces `Alpha(...)` with `~"Alpha(...)"`? It is still modifying 3rd party source, but at least it'll do it reliably. – Derek Nguyen Jan 29 '19 at 08:57
  • I found a great example here: https://github.com/mediafreakch/less-plugin-sass2less/blob/master/lib/index.js – Derek Nguyen Jan 29 '19 at 08:59

0 Answers0