-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
width: -webkit-fill-available;
is removed unexpectedly
#826
Comments
Please provide a reproduction. Try the playground here: https://lightningcss.dev/playground/index.html |
I did more investigation and found the cause finally. I use So lightningcss removes non standard values if targets are not specified. Here's reproduction: |
I can confirm the issue. I was stumped because I could only reproduce via my rollup setup (and The most confusing part is that |
I think this is working as expected? You should always provide browser targets to lightningcss. If you don't, we assume you are targeting a theoretical browser with perfect support for standards, so fallbacks and prefixes will be removed. We need to know what browser you actually want to target so we can output the correct code. |
Hmm but isn't it counter intuitive? Since if you don't supply the target that means you don't know which browser will use the code, thus it definitely shouldn't remove anything at least. Just perhaps not adding anything extra? It just leads to hard to pinpoint problems like this one with Vite |
I think that inheriting Vite's targets is a "good default", however removing the prefixed value is a bug because no browser currently supports the non-prefixed value. Another way to think of it: it's not a "prefixed value", but just "a valid value for all current browsers". As such, it should not be removed. |
I'm using Lightning CSS for
cssMinify
option in Vite and I noticed it removeswidth: -webkit-fill-available;
in production styles.I also tried to do this in Vite config:
but it still removes the rule.
What is wrong?
Lightning CSS version: 1.27
Vite: 5.4.8
The text was updated successfully, but these errors were encountered: