Skip to content

0007 The theme tokens are a contract

Sources: #2, #23, #66

Context and Problem Statement

A company wants its colours in every chart of an app without passing them to each one (#2). #23 added CSS custom properties that the ECharts module reads from the app's stylesheet. The pivot module came later and reads the same tokens (#66).

Considered Options

  • Separate properties per module (not discussed in a source).
  • One set of --psu-chart-* tokens that every module reads.

Decision Outcome

Chosen option: one set of --psu-chart-* tokens (#66). Today the ECharts module reads them in Components/themes.js and the pivot module in psu.css; docs/echarts/themes.md documents them.

  • A token is added to that page and to its reader together.
  • Renaming or removing a token is a breaking change in every module.

The reason recorded in #23 for the tokens: charts take a company's design without passing -Palette to each one. AGENTS.md since #66 calls them the contract between the modules and an app's stylesheet. Why the modules share one set: reason not recorded.

Consequences

  • Good: one stylesheet themes every module of an app.
  • Bad: a token cannot be renamed or removed without a breaking release of every module.