lightningcss icon indicating copy to clipboard operation
lightningcss copied to clipboard

Some invalid CSS values are removed silently, while others are not

Open robw-mercury opened this issue 3 months ago • 0 comments

Current behavior

Some invalid CSS values are removed silently when re-serialized, but others are not.

Source:

.foo {
  /* Value does not exist in the spec. The correct value is `unset` */ 
  border-image: none; 
  /* Values also do not exist in the spec */
  animation-play-state: none;
  position: none;
}

Result:

.foo{animation-play-state:none;position:none;border-image:}

Link to playground.

Suggested behavior

Should we get a warning that a value is invalid? Or is this the job of a linter used alongside Lightning CSS?

Is it intentional that some invalid values are removed, while others are printed as-is?

Also, thank you for this project! We're very excited to use it in our company.

Related issues:

  • https://github.com/parcel-bundler/lightningcss/issues/569: describes bad pseudo-selectors being removed from output
  • https://github.com/parcel-bundler/lightningcss/issues/680: describes bad values that remain in the output

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