parcel-bundler / lightningcss

An extremely fast CSS parser, transformer, bundler, and minifier written in Rust.
https://lightningcss.dev
Mozilla Public License 2.0
6.56k stars 190 forks source link

light-dark() is always being replaced #773

Closed jcayzac closed 3 months ago

jcayzac commented 4 months ago

The --lightningcss-light/--lightningcss-dark polyfill always gets generated on 1.25.1, even if I pass:

{
  targets: { chrome: 126 },
  include: 0,
  exclude: 0xffffffff,
}

How can I disable that? light-dark() is supported by all major browsers, and for chrome specifically since 123.

I also didn't expect any transpilation if I disabled all the features. Just minification.

jcayzac commented 4 months ago

Shouldn't this behavior be governed by Features.ColorFunction ? From the source code, it seems unconditional if the target doesn't support it (I guess it must be using outdated compatibility data).

jcayzac commented 4 months ago

Hmm even if I enforce the latest versions of caniuse-lite and @mdn/browser-compat-data, it still injects it…

jcayzac commented 4 months ago

With targets: {} it works.

sven-meyer-wetter-com commented 4 months ago

I've the same problem....

devongovett commented 3 months ago

See the docs for how to configure targets: https://lightningcss.dev/transpilation.html#browser-targets

you need chrome: 126 << 16