finos / a11y-theme-builder

DesignOps toolchain theme builder for accessibility inclusion using Atomic Design.
Apache License 2.0
46 stars 69 forks source link

[SDK] Add support to manage multiple themes in a design system #1054

Open aaronreed708 opened 2 weeks ago

aaronreed708 commented 2 weeks ago

Problem/Concern

This issue is to investigate, design and code how the SDK can manage multiple themes in a design system. Caller will need to be able to create a new named theme, query a named theme, update a named them and delete a named theme.

Some questions that may need to be answered:

Proposed Solution

aaronreed708 commented 1 week ago

It looks like https://github.com/finos/a11y-theme-builder-sdk/blob/main/src/atoms/colorThemes.ts already supports multiple themes. So we would just need to call designSystem.atoms.colorThemes.createTheme to create a new theme and have it added to the set maintained by colorThemes.

@omesh-omg does this satisfy your needs? There doesn't appear to be a colorTheme deletion capability. We could maybe add support for that. Would you need that? Do we need to restrict and not allow the default theme to be deleted?

aaronreed708 commented 1 week ago

We also need to ensure that the generated JSON and CSS w.r.t. multiple themes will work with Figma as well as make sense and be consumable for a developer to is trying to use the design system. And in V2 where generation is strictly JSON, the JSON needs to have enough theme information in it to allow good CSS to be created.