Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FInd a way to keep in sync design tokens doc with tokens.ts #56

Open
NathanVss opened this issue May 17, 2023 · 1 comment
Open

FInd a way to keep in sync design tokens doc with tokens.ts #56

NathanVss opened this issue May 17, 2023 · 1 comment

Comments

@NathanVss
Copy link
Member

NathanVss commented May 17, 2023

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"],
});
@lebaudantoine
Copy link
Collaborator

I would really appreciate this feature 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants