I have tokens set up using Figma Tokens (Tokens.Studio). I am trying to create a dark theme and allow users using external files to switch back and forth between the light and dark theme.
Here is the problem I have:
I have created all the dark tokens, so I do have a light and dark theme. I now have these as two different json files. I can switch back and forth by copying and pasting into two different sets (light and dark), and even use theme switcher to change from light to dark.
Works great when I’m changing from light to dark in the main file itself. However, I want anyone who connects to this library from an external file to be able to switch back and forth. However, when you open Figma Tokens in the external file, it shows no tokens.
I think the path forward may involve creating a duplicate set of styles, one for light. and one for dark., and then using the Appearance plugin which allows a user to switch back and forth between style sets that start with a different name. (Styles are applied to every component and connected to Figma Tokens so needs to maintain that connection).
However, I can’t seem to create a duplicate set of styles. I can load the two sets which creates two different sets of tokens, problem is I then have light.xyz and dark.xyz, but my aliases still point to xyz, so every token that uses an alias is broken. And I still don’t have a duplicate set of styles that I can switch from.