Problem
validateName() at 94bf4d8 rejects empty names, periods, value, and selected reserved module names, but accepts whitespace and CSS delimiter characters.
processPrimitives() then interpolates these names directly into the declaration key.
Reproduction
This configuration passes the current name checks:
const config = {
primitives: {
"card button": {
value: {
default: {
value: { gap: "1rem" },
},
},
},
},
};
The current construction produces:
--card button-default-gap: 1rem;
The unescaped space makes this an invalid custom-property declaration name. The result follows directly from the current validator and string construction; add an end-to-end generator/browser regression test.
The same gap applies to other unescaped delimiters that are not excluded by the validator. CSS custom-property names must be valid dashed identifiers; see the specification.
Proposed contract
Choose one explicit policy:
- Reject unsupported name segments with a useful configuration-path error; or
- Escape names consistently when emitting CSS, while preserving stable configuration paths and references.
Do not silently normalize distinct names into the same generated key. Do not apply identifier restrictions to arbitrary token values, which intentionally contain native CSS expressions.
Acceptance criteria
Problem
validateName() at 94bf4d8 rejects empty names, periods,
value, and selected reserved module names, but accepts whitespace and CSS delimiter characters.processPrimitives() then interpolates these names directly into the declaration key.
Reproduction
This configuration passes the current name checks:
The current construction produces:
The unescaped space makes this an invalid custom-property declaration name. The result follows directly from the current validator and string construction; add an end-to-end generator/browser regression test.
The same gap applies to other unescaped delimiters that are not excluded by the validator. CSS custom-property names must be valid dashed identifiers; see the specification.
Proposed contract
Choose one explicit policy:
Do not silently normalize distinct names into the same generated key. Do not apply identifier restrictions to arbitrary token values, which intentionally contain native CSS expressions.
Acceptance criteria