@pairdraw/dom-css 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -508,6 +508,24 @@ function variantNames(scopes) {
508
508
  * references, and number formulas `calc()` over them; both are declared again in each mode that
509
509
  * changes what they point to.
510
510
  */
511
+ /**
512
+ * A name that took a numeric suffix is an alias nobody can read back from the stylesheet, so it
513
+ * is reported rather than left as a silent second spelling of another token.
514
+ */
515
+ function numberedNameIssues(variables, names, modeOf) {
516
+ const issues = [];
517
+ for (const variable of variables) {
518
+ const name = names.get(variable.id);
519
+ const base = deriveCSSName(variable);
520
+ if (!name || explicitCSSName(variable) || name === base) continue;
521
+ issues.push({
522
+ message: `"${variable.name}" is written --${name}: --${base} is taken`,
523
+ variableId: variable.id,
524
+ modeId: modeOf(variable)
525
+ });
526
+ }
527
+ return issues;
528
+ }
511
529
  function buildTokenStylesheet(source, { format, include = () => true }, validate) {
512
530
  const issues = [];
513
531
  const collections = [...source.variableCollections.values()];
@@ -539,6 +557,7 @@ function buildTokenStylesheet(source, { format, include = () => true }, validate
539
557
  value: css
540
558
  };
541
559
  }
560
+ issues.push(...numberedNameIssues(variables, names, defaultModeOf));
542
561
  const defaults = /* @__PURE__ */ new Map();
543
562
  const theme = [];
544
563
  const root = [];