cunningham
cunningham copied to clipboard
FInd a way to keep in sync design tokens doc with `tokens.ts`
At the moment, for each component we need to manually define a Design tokens doc part and to make sure we exhaustively list and explain all available tokens defined in tokens.ts.
What I propose is to write a script in some way that parses tokens.ts and generate the Design tokens doc part, to achieve that we would maybe need to define descriptions of design tokens in comments like that:
import { DefaultTokens } from "@openfun/cunningham-tokens";
export const tokens = (defaults: DefaultTokens) => ({
// Color of the background
"accent-color": defaults.theme.colors["success-600"],
// Color of the background
"rail-background-color": defaults.theme.colors["greyscale-500"],
});
I would really appreciate this feature 🤗