You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#25 documents a concrete example where a root-level alias references palette variables emitted only under .Another. The reference is valid only under additional DOM or external-CSS assumptions that the configuration does not communicate.
The current ResolveMap in lib.ts retains key, value, and variable, but not the selector/at-rule context in which the declaration is emitted.
Retaining that context would allow useful warnings without trying to replace the browser's cascade or solve arbitrary selector relationships.
Proposed behavior
For a root alias whose only configured source declaration is restricted to .Another, report something like:
Token theme.dark.background.primary is emitted at :root under
@media (prefers-color-scheme: dark), but its referenced token
palette.another.yellow is only emitted under .Another.
The source must be available on the element where the alias is computed.
This configuration requires .Another to match the root, or an external
source declaration at that location.
Treat this as a potential availability problem, not proof that the final application CSS is invalid. The application may deliberately supply external declarations or specific root classes.
Initial scope
Retain declaration context and provenance during token processing.
Compare straightforward cases: identical contexts, an unconditional root source consumed by a descendant, a root consumer with only a selector-restricted source, and a broader consumer with only a conditionally available source.
Warn for assumptions the generator cannot establish; leave arbitrary selector implication and complex media-query reasoning out of scope.
Motivation
#25 documents a concrete example where a root-level alias references palette variables emitted only under
.Another. The reference is valid only under additional DOM or external-CSS assumptions that the configuration does not communicate.The current ResolveMap in lib.ts retains
key,value, andvariable, but not the selector/at-rule context in which the declaration is emitted.Retaining that context would allow useful warnings without trying to replace the browser's cascade or solve arbitrary selector relationships.
Proposed behavior
For a root alias whose only configured source declaration is restricted to
.Another, report something like:Treat this as a potential availability problem, not proof that the final application CSS is invalid. The application may deliberately supply external declarations or specific root classes.
Initial scope
Acceptance criteria
This is separate from correcting the existing example in #25.