I wrote simple regex that works inside VS CODE.
- Select all the colors you want to export
- Go to the code tab inside figma
- Copy all the code to the text document in VS CODE
- Use my regex1
\/\* (.*) \*\/\nbackground: #(.*);and in replace
- Use another regex to wipe out unwanted CSS
position: absolute;\nleft:(.*);\nright:(.*);\ntop:(.*);\nbottom:(.*);\nand in replace ``
Remember to turn on regex in find and replace in VS Code
It saves like 30 minutes of composing this file for huge color palettes. It is kinda hacky, so please tell me if there is any other method.