Skip to content

Custom transform API truncates custom property name #399

@stevenpetryk

Description

@stevenpetryk

Hey there, just a tiny surprise when using the new visitor API. My use case is this:

.foo {
- color: opacity($black, 0.5);
+ color: hsl(var(--black-hsl) / 0.5);
}

But I noticed that LightningCSS was transforming to:

.foo {
  color: hsl(var(--ack-hsl) / 0.5);
}

A small reproduction shows that the ident passed to any var gets its first two characters chopped off.

Playground link ↗️

Of course, fixing was as easy as prefixing the ident with two characters, but that doesn't seem right.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions