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

Comments for categories, etc. (not just properties) #463

Open
lukasoppermann opened this issue Sep 25, 2020 · 4 comments
Open

Comments for categories, etc. (not just properties) #463

lukasoppermann opened this issue Sep 25, 2020 · 4 comments

Comments

@lukasoppermann
Copy link
Contributor

It would be great if comments could be supplied at other levels of the json tree and not just within a property.

Use case:

{
  "color":{
    "utilities":{
      "comment":"Use these colors only when specified in design docs, they are only to be used in specific situations",
      "error":{
        "value":"red",
        "comment":"Use for error text on bg-error"
      }
    }
  }
}

This would than ideally translate to something like this in css and similarly to other languages.

/* Use these colors only when specified in design docs, they are only to be used in specific situations */
--color-utilities-error: red; /* Use for error text on bg-error */

Since one of the big benefits of design tokens should be that it brings more documentation to a design system, allowing for more written documentation within the system would be very helpful towards this goal.

@vkoopmans-resoluut
Copy link

Absolutely! Great idea

@dbanksdesign
Copy link
Member

Those would work, except those comments (or any other metadata) would not be reflected in some formats, like css/variables or scss/variables for example. Other than the issue with json/nested (#464 and PR #465 ), the json format will pass that data through to the output. But maybe we could make css/variables and scss/variables output those comments as well.

@lukasoppermann
Copy link
Contributor Author

It would be awesome if the comments would be added above the nested values. 😍

@jared-christensen
Copy link

I think supporting category comments would make storybook design tokens easier to work with. https://github.com/UX-and-I/storybook-design-token

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

No branches or pull requests

4 participants