microsoft / fluentui-token-pipeline

The Fluent UI token pipeline generates source code for Fluent UI libraries.
https://microsoft.github.io/fluentui-token-pipeline/
Other
41 stars 18 forks source link

HTML export: set naming #3

Closed TravisSpomer closed 3 years ago

TravisSpomer commented 4 years ago

The HTML export feature does a decent job at picking useful names for sets, but since sets aren't a distinct thing in the JSON, it could do better in some cases. For example, if there's a set of tokens that all follow the format Set-Neutral-Fill-Color-_____, the HTML export will call it Set-Neutral rather than Set-Neutral-Fill-Color. When it identifies a set, it should identify the longest string that still matches all defined tokens in the set.

In fluentui-html.js, look for the fluentui/html/reference formatter:

header = (header || "") + `<h2>Set-${thisProp.path[1]}</h2>\n\n`
TravisSpomer commented 3 years ago

Closing this for now as the HTML export isn't directly used by anything.