Introduction π
Many people use Figma for designing and need to copy the styles to VS Code from there or just see the styles in VS Code to code their websites like the way they designed it. Hence, it's a great pain to work with both on a single monitor. But VS Code being the most powerful code editors, it can handle it all.
Solution π
There's an extension in VS Code: Figma by Kasper Mikiewicz. This is the goto solution for this. I have been using it for the past few days and it is damn amazing.
Installation β
First of all, there are some requirements, let's fulfill them. By the way, the same you will find on the extension page in VS Code, but these are more elaborate.
Requirements
- Figma Personal Access Token
- Team ID
If you don't know how to get them here's how:
- Go to Account Settings in Figma.
- Click on Create a new personal access token.
- Name your token and copy it.
- In VS Code open the commands by using Ctrl + Shift + P menu and execute Figma: Connect.
- Paste your Figma token and press enter.
Team
You must be a part of any team to be able to browse and select files or you can create your own team. To get your team id:
- Go to Figma and click on any team in the sidebar
- Copy id from URL: https://www.figma.com/files/team/ID/example. But for this, you will have to open it in the browser.
- In VS Code open the commands menu by using Ctrl + Shift + P and execute Figma: Add Team command
- Type in your team name
- Paste team id and press enter
- You're now able to select any team file using Figma: Select File from the command palette.
Limitations π’
Browsing files works only for teams. You can't browse your drafts. But they say that in the future there will be support for adding single files by id.
Also, it is in the preview version. With the release version of 0.1.0 at the time of writing this article.
Conclusion
This extension has helped me save my time and will definitely help you integrate your Figma designs into code with great ease and saving a lot of time.
Top comments (1)
Thanks for this article, please I need more light on this project. I have been struggling to link my Figma file with VS Code. Now I have succeeded but still can't see the code as illustrated on the preview image above.