principle / No direct component-to-global reference

No direct component-to-global reference

组件只能通过 L3/L4 契约消费 Token,不直接绑定 L1 Global Token。

Key fields

What

Definition
组件只能通过 L3/L4 契约消费 Token,不直接绑定 L1 Global Token。

Why

Core Question
如何防止组件绕过语义层,逐渐变成不可迁移的局部实现?
Mechanism
Component Slot 的绑定 Token 视图成为唯一消费入口;直接 L1 绑定记录为违规。

How

Primary Use
保护 Global 与 Semantic 层的职责边界,使组件可以更换主题和品牌。
Design Guidance
Button、Input、Card 等组件的所有公共视觉属性都经过 Component Slot。

Evidence

Limitations
极小型系统可能暂时没有 L3;此时必须明确记录迁移计划。
Last Verified At
2026-08-21
Common Mistakes
因为某个 L1 值“看起来合适”就直接复用。

Lifecycle

Status
在用