Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwind (JSX) Not Generated when Selecting Components Variants Within Component Group #168

Open
Samcob opened this issue Feb 11, 2025 · 4 comments · May be fixed by #170
Open

Tailwind (JSX) Not Generated when Selecting Components Variants Within Component Group #168

Samcob opened this issue Feb 11, 2025 · 4 comments · May be fixed by #170

Comments

@Samcob
Copy link

Samcob commented Feb 11, 2025

I'll start by saying that I am a designer who is coordinating with our development team the use of Figma Dev-Mode and the Figma to Code plugin. We also just acquired Figma in the last couple of months, so I'm still learning the ins-and-outs of the tool. I apologize in advance if the solution to this issue is something that doesn't pertain to your fantastic plugin.

With that being said, it appears that the Figma to Code plugin is not generating code when selecting a component variant (within the component group outlined in purple) in Dev mode. It will display the code just fine if you make a separate, single instance of the component, but for our documentation process we would prefer to deliver components to the dev team in their original component groups. The weird thing is that it seemed to have been working initially, but now when I, or other devs on the team, try to use the plugin by selecting a component variant, it either loads forever or simply does not display any code. Is this a know issue, and if so are there any work-arounds? I'm not sure if this is a limitation of Figma or with the Figma to Code plugin, but it is a feature that would be highly beneficial for our usage. Screenshots for reference:




Selecting the desired component variant from the "plugin" sidebar indicates that "no layer is selected." I've tested with other code-gen plugins and they are able to recognize the component variant and generate code:

Image

Selecting a component variant within it's component group (and the code not being displayed): Image

Figma to Code properly generating Tailwind JSX for an individual separate instance of the component: Image

Again, the desired/expected outcome from the perspective of our team would be that Figma to Code would generate the Tailwind JSX when selecting the component variant within each component group. Any follow-up would be greatly appreciated.
@Samcob Samcob changed the title Tailwind (JSX) Not Generated when Selecting Components Varients Within Component Group Tailwind (JSX) Not Generated when Selecting Components Variants Within Component Group Feb 11, 2025
@bernaferrari
Copy link
Owner

sos @Lampenbauer

@Lampenbauer
Copy link
Contributor

@bernaferrari I have just investigated and found the point at which the ability to select Figma component sets and variants within component sets no longer works. The bug occurred a little over a month ago, but was only noticed/reported now. It also affects all modes (HTML, Tailwind, etc.). @mimshwright can you try to fix this please?

Image

@bernaferrari
Copy link
Owner

Wow, you went a lot deeper than I thought, thanks a lot!

@mimshwright
Copy link
Contributor

To add some details to this bug:

  • The bug was introduced in Big Fat New Years' Refactor (ef552e4)
  • it's happening with all frameworks, not just tailwind
  • selecting another element then selecting the variant results in no change to the plugin (it doesn't recognize it as being a new selection at all)
  • I'm seeing the error: "// ERROR in get_componentPropertyDefinitions: Can only get component property definitions of a component set or non-variant component" when I select

@mimshwright mimshwright linked a pull request Feb 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants