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

Generate theme for @fluentui/react-components #52

Closed miroslavstastny closed 3 years ago

miroslavstastny commented 3 years ago

Add support for generating theme files for Fluent UI React v9 (@fluentui/react-components).

This PR adds Single Source of Truth JSON files representing Design's point of view on the themes:

Running the pipeline generates typescript implementation of global and alias color tokens:

THEME=light && node dist/cli -p react --in src/demo/fluentui-global.json --in src/demo/fluentui-$THEME.json --out build/$THEME

There are currently only colors implemented, more kinds of tokens will follow.

This version of the pipeline was used to generate the theme files in @fluentui/react-components in https://github.com/microsoft/fluentui/pull/18321.

miroslavstastny commented 3 years ago

The CI is now failing as there is a separate set of json files used by the react platform. @TravisSpomer may I ask you for a recommendation on this?

TravisSpomer commented 3 years ago

The CI is now failing as there is a separate set of json files used by the react platform. @TravisSpomer may I ask you for a recommendation on this?

The CI is basically just running npm run transform, so you should be able to see the error locally with that. It looks like what's happening is that one of the transforms in fluentui-react.ts is making assumptions about the input JSON and just needs an if (!something) return.