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

W3C DTCG format input #74

Closed TravisSpomer closed 1 year ago

TravisSpomer commented 1 year ago

This PR adds support to the pipeline for consuming W3C DTCG draft format token files. JSON files and the proprietary syntax and the DTCG format can be mixed and matched—the pipeline will convert DTCG tokens into the old syntax when loading so that existing code investments continue to function.

This is not a general-purpose DTCG format parser—think of it as a custom compatibility shim, not a full parser. I'm only supporting the specific token types and syntaxes that the Fluent platforms are using. I'm also assuming that the shadow token type will be extended to support an array of shadows, which seems virtually guaranteed but is not formally allowed by the spec.

Without changing input files to the DTCG format, this PR should introduce only minimal changes: