lightningcss icon indicating copy to clipboard operation
lightningcss copied to clipboard

Support “custom units”

Open nicksrandall opened this issue 3 years ago • 1 comments

CSS Custom Units proposal was recently accepted and it would be awesome if parcel CSS allowed us to use that syntax today and then compile it down to what is currently supported by browsers.

See: https://github.com/w3c/csswg-drafts/issues/7379#issuecomment-1170229274

nicksrandall avatar Jul 02 '22 01:07 nicksrandall

Interesting. Perhaps a bit early to implement, but I look forward to seeing the spec.

devongovett avatar Jul 03 '22 17:07 devongovett

This could be implemented as a custom transform now: https://lightningcss.dev/transforms.html. There's an example of this in the tests: https://github.com/parcel-bundler/lightningcss/blob/6fb77292c9ef4320fa85a1e26fec3fbdbae3cf8a/node/test/visitor.test.mjs#L34-L86.

I'll leave this open to implement natively once it appears in a spec though.

devongovett avatar Jan 04 '23 17:01 devongovett