Skip to content

Broken relative formatting in css oklch(from ... +130) #18320

@green7ea

Description

@green7ea

Prettier 3.6.2
Playground link

Input:

:root {
  --color-my-green: oklch(from rgb(255, 0, 0) l c +130);
}

Output:

:root {
  --color-my-green: oklch(from rgb(255, 0, 0) l c + 130);
}

Expected output:

:root {
  --color-my-green: oklch(from rgb(255, 0, 0) l c +130);
}

Why?

Adding a space between the + and the 130 changes the behaviour of the css. This is not a normal addition but putting the + there makes the 130 relative instead of absolute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions