lukasoppermann / design-tokens

🎨 Figma plugin to export design tokens to json in an amazon style dictionary compatible format.
https://www.figma.com/community/plugin/888356646278934516/Design-Tokens
MIT License
964 stars 134 forks source link

There is no way of exporting "transparent" tokens #179

Closed mihail-alexe-nutanix closed 2 years ago

mihail-alexe-nutanix commented 2 years ago

UX, in my case, defined multiple (let's say N) Figma files with N sets of tokens for each theme. In case of some color tokens, some values have transparent values (ie. no paint, or rgba(0, 0, 0, 0))

For example

Background/Button/Secondary has value #CCC in and transparent in . The example here is just for the sake of providing an example, so please don't judge the UX approach.

For more context, tokens from figma are exported through design tokens, transformed with style-dictionary into CSS files, and then used in our web app. We have a default theme, defined in :root, so in order to make something transparent we need to override the values defined in the default.

The problem(s)

The Design Tokens plugin ignores Color tokens without paint. Adding a 0 opacity, because of some default values using || the value ends up being 1 (full opaque).

Proposed solution

⚠️ I have already worked on a fix and I'm ready to open a PR if you agree it's indeed a valid use case.

lukasoppermann commented 2 years ago

Fixed in #180