Skip to content

CSS indentifiers not identified correctly #1084

@toastal

Description

@toastal

Describe the bug

Some characters are not being properly identified as identifiers—despite tree-sitter, at least in my editor, working correctly & browsers working correctly.

To Reproduce

Attempt to format

.Metric-range--0-¼ {
  --Metric-track-gradient: var(--greenLight), var(--green), var(--yellowLight) 27%, var(--yellow), var(--orangeLight) 53%, var(--orange), var(--red) 81%, var(--red);
}
$ topiary format test.css && echo "SAD"
[2025-09-18T10:19:03Z ERROR topiary] Parsing error between line 1, column 18 and line 1, column 20

But

/* no ¼ */
.Metric-range--0- {
	--Metric-track-gradient: var(--greenLight), var(--green), var(--yellowLight) 27%, var(--yellow), var(--orangeLight) 53%, var(--orange), var(--red) 81%, var(--red);
}
$ topiary format test.css && echo "SAD"
SAD

Expected behavior

Metric-range--0-¼ is a valid CSS identifier. No error.

Environment

  • OS name + version: NixOS unstable
  • Version of the code: topiary-cli 0.6.1

Additional context

Image

Screenshot of Neovim’s :InspectTree identifying the identifier.

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