-
-
Notifications
You must be signed in to change notification settings - Fork 323
Open
Labels
Description
Describe the bug
When the CSS contains color relative syntax with calculation like this:
oklch(from var(--accent-l) calc(l + 0.05) c h);
We get an error at build time:
Erroneous area:
1: l + 0.05
^..^ [postcss-calc]
57:3 ⚠ Lexical error on line 1: Unrecognized text.
Expected behaviour
We expect cssnano to detect relative color syntax as an exception.
Steps to reproduce
Add a relative color with a calculation in the css
oklch(from var(--accent-l) calc(l + 0.05) c h);
Run css nano with default parameters
Version
7.1.2
Preset
default
Environment
System:
OS: Linux 6.14 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
CPU: (32) x64 Intel(R) Xeon(R) Silver 4208 CPU @ 2.10GHz
Memory: 52.71 GB / 62.52 GB
Container: Yes
Shell: 5.2.21 - /bin/bashPackage details
Additional context
I tried added /* postcss-calc: ignore */ before problematic lines, but comment seems to be removed before processing the line.
I tried @csstools/postcss-relative-color-syntax but doesn't work either.
It seems that newer versions of postcss-calc support relative color syntax
Reactions are currently unavailable