Skip to content

[Bug]: Does not understand CSS Color level 5 relative color functions #216

@lachieh

Description

@lachieh

Describe the bug

When using the new(ish) CSS Color level 5 functions with relative colors, I get a warning about 'Unrecognized text'.

Expected behaviour

I'd expect that this be left alone for the browser to calculate at runtime. I imagine there are some cases where its possible to calculate the final value, but taking things like color spaces into consideration to do the calculation seems like it might be a little far out of scope for this project. That's just my opinion, though.

Steps to reproduce

input:

a {
   color(from blue oklab calc(l * 0.9) a b / alpha)
}

warning:

Lexical error on line 1: Unrecognized text.

Erroneous area:
1: l * 0.9
^..^

Version

9.0.1

Environment

System:
    OS: macOS 14.6
    CPU: (10) arm64 Apple M1 Max
    Memory: 496.95 MB / 64.00 GB
    Shell: 5.9 - /bin/zsh

Package details

postcss-calc@9.0.1
postcss@8.4.40

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions