-
Notifications
You must be signed in to change notification settings - Fork 243
Closed
Description
Using lightningcss@1.21.0 from npm.
$ node
Welcome to Node.js v20.2.0.
Type ".help" for more information.
> test=value=>(require("lightningcss")).transform({code:Buffer.from(`x{x:color-mix(in srgb,${value},blue)}`),minify:true}).code.toString()
[Function: test]
If you use two regular colours, it mixes them itself (✓):
> test`red`
'x{x:purple}'
If you use a variable, it skips it (✓):
> test`var(--x)`
'x{x:color-mix(in srgb,var(--x),blue)}'
But if you use currentcolor, it thinks it can do it because it’s a <color>, but it can’t actually since it’s resolved at runtime, and crashes (✘):
> test`currentcolor`
thread '<unnamed>' panicked at 'internal error: entered unreachable code', src/values/color.rs:2923:12
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Wouldn’t surprise me if currentcolor could cause other crashes too. I haven’t gone looking.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels