lightningcss icon indicating copy to clipboard operation
lightningcss copied to clipboard

Doesn't error on invalid property or value

Open KevinBatdorf opened this issue 1 year ago • 1 comments

Neither of these error but I would expect them to. If it's not meant to error, would you recommend some way to approach getting that information?

For example, I can use the Declaration visitor and get the property/value but not the location. Thanks

p {
  foo: blue;
}
p {
  color: bluezzzz;
}

KevinBatdorf avatar Feb 20 '24 19:02 KevinBatdorf

I believe this is answered by this comment: https://github.com/parcel-bundler/lightningcss/issues/569#issuecomment-1713010069.

It's less that it's being removed and more that it doesn't parse. CSS error recovery is very lenient, and it is ignored just like a browser would. Wiring through the logger to the selector parser might be possible but would take some work.

robw-mercury avatar Sep 05 '25 17:09 robw-mercury