Convert Figma to WordPress Theme using AI | Claude Code + Figma MCP Server for Design to Code — Transcript
Full transcript
- 0:00Hello everyone. In this video we're
- 0:02going to learn how to give a Figma file
- 0:05to AI Cloud Code
- 0:07and ask it to build the entire theme for
- 0:11us with the styles, with index file, all
- 0:15the classic theme related files like
- 0:17functions.php
- 0:19and basically build the whole page for
- 0:21us as a page template. First of all, is
- 0:23that even possible? And if it is, how
- 0:26can we do that?
- 0:28Well, the answer is yes, it is possible.
- 0:30So, how do we do it?
- 0:33Basically,
- 0:35uh Cloud Code is going to read our Figma
- 0:37design. All we're going to do is just
- 0:40give this Figma link. Uh so, let's say
- 0:43you receive a design from the designer
- 0:45or you built it yourself
- 0:47and you have a Figma URL. All we're
- 0:49going to do is just give this URL to
- 0:51Cloud Code and then it's going to build
- 0:54this landing page, article page, about
- 0:56page. We're going to ignore the shop and
- 0:58product details, but we'll focus on
- 1:00these basic pages first.
- 1:03Right. Uh
- 1:04so, um
- 1:07it's going to read through the Figma
- 1:08design through Figma MCP server
- 1:11and it's going to scaffold the whole
- 1:13classic theme for us
- 1:15and it's going to follow all the
- 1:16template hierarchy, uh create the index
- 1:18file, uh the single.php, etc.
- 1:22Uh
- 1:23and also the the home page and it's
- 1:26going to enqueue all the styles and
- 1:28scripts, etc. Okay? What we're going to
- 1:30need for this is basically Node.js and
- 1:32NPX. Uh I already have got that
- 1:35installed. If you haven't, then you can
- 1:36install it.
- 1:37And um one of the most important thing
- 1:39we're going to need is Figma personal
- 1:41access token. There are different ways
- 1:43to do it, but um if you have a free
- 1:45account with Figma, this will be the the
- 1:48easiest one to do.
- 1:49Otherwise, uh you're going to need to
- 1:52buy the pro version of Figma. But, in
- 1:54this video I'm going to show you the
- 1:56free one if you have a free Figma
- 1:58account, so you don't have to
- 2:00buy a pro version. Okay. Uh and then you
- 2:03once you create a personal access token,
- 2:05you need to give the read only access
- 2:08for the file content for the cloud to be
- 2:10able to read um all of the content of
- 2:13your Figma file in order for it to
- 2:14generate it for you.
- 2:16And of course, the access to the cloud
- 2:17code uh in your project directory.
- 2:20How it's going to work is you will
- 2:22create the personal access token. Then
- 2:26you're going to run this command uh by
- 2:28passing your uh token
- 2:30uh on on your terminal.
- 2:32It's going to verify its connection.
- 2:34You're going to restart the cloud code.
- 2:36And then it's going to basically read
- 2:39the layout styles, colors, export the
- 2:41image icon assets, and it's going to
- 2:43build the theme for you. Okay. So,
- 2:46uh let's just um start to see how that
- 2:49goes.
- 2:51So, I have got
- 2:53uh the local uh WordPress running.
- 2:55And um
- 2:57in this folder, sites folder, which is
- 2:59basically this guy, WordPress example,
- 3:01uh I'm going to run the cloud code.
- 3:05And then I'm going to give this a
- 3:07command.
- 3:08Okay, so I'm going to say build
- 3:11a classic oops
- 3:13build
- 3:15a classic WordPress
- 3:19theme
- 3:21here
- 3:23using the Figma
- 3:26design.
- 3:28And
- 3:30here is my Figma link.
- 3:35And this is my Figma Figma link which
- 3:36I've copied and I'm going to paste it
- 3:38over here. And I'm going to hit enter.
- 3:40All right. So, it took a it took some
- 3:42time and here is what it's got for me so
- 3:44far. So, it says, "Let me set this up.
- 3:47The Figma cloud code connection uses
- 3:49Figma's official dev mode MCP server,
- 3:52which runs locally through the Figma
- 3:54desktop app. And let me check your
- 3:56current setup.
- 3:58So, it checked a few things.
- 4:00Uh here is what it found. Figma desktop
- 4:02app is installed. So, I have got the
- 4:04Figma uh desktop app, as you can see,
- 4:07installed already.
- 4:09And um what it doesn't have is it
- 4:12doesn't have the MCP server yet.
- 4:14No Figma MCP configured in the Claude
- 4:17code yet. So, it's saying that there are
- 4:19two ways to do it.
- 4:20Um
- 4:22one is
- 4:25connect Figma. Which one you use depends
- 4:27on your Figma plan. Let me
- 4:29have you pick up. Okay. So,
- 4:31it gave me a couple of choices and um I
- 4:34went with
- 4:36using the token because I have the free
- 4:39plan.
- 4:40Um
- 4:42Okay, and then it's setting that up for
- 4:43me.
- 4:44Uh it says node and NPX are ready. Now,
- 4:47you need Figma personal access token.
- 4:49So, it gives me the step how to
- 4:52basically get that information. So, I'm
- 4:54going to go ahead and get that.
- 4:56So, I'll just go to Figma
- 4:59.com.
- 5:01Then, I'm going to click on the icon.
- 5:04So, it says, "In Figma, click your on
- 5:06your avatar and then settings."
- 5:09So, avatar and then settings.
- 5:13And then uh
- 5:15personal access token, generate new
- 5:17token. So, I'm going to go to security.
- 5:19Uh and then I'm going to click on
- 5:21generate new token.
- 5:23And then I'm going to give this a name
- 5:25of
- 5:26Claude code token.
- 5:31Okay. And then it says, uh
- 5:35"Give it a name."
- 5:36And then for scope, set the file content
- 5:39read only. That's all that's needed.
- 5:41So,
- 5:42let's see. File comment, file content
- 5:45read only, right?
- 5:47Um
- 5:48I can give more read options if it needs
- 5:50to, but basically you need to
- 5:52give the read option only and nothing
- 5:55else.
- 5:57Okay, I think that should be okay. And
- 5:59then I'm going to generate token.
- 6:01So, generate token. You can see that
- 6:03I've got the uh cloud code token over
- 6:05here. You can click on this to copy it.
- 6:08Uh later on you won't be able to copy
- 6:10it, so make sure you copy it from here.
- 6:12And then uh step two is add the MCP
- 6:15server to the cloud code.
- 6:17Once you have the token, you'll have two
- 6:19options. Recommended uh type this prompt
- 6:22and replace
- 6:23this one uh
- 6:25this guy with the token and hit enter.
- 6:27And second is just paste
- 6:30uh your token here and then I'll run the
- 6:32command for you. Okay? So, I'm going to
- 6:34go with the option one. So, I'm going to
- 6:37copy this, paste it, and then I'm going
- 6:40to
- 6:41copy this token.
- 6:43And I'm going to replace
- 6:45your token here.
- 6:47And then I'm going to run this command
- 6:49on the terminal.
- 6:50All right. So, as you can see I ran that
- 6:52command and now it asked me to restart
- 6:55the restart the cloud.
- 6:58And uh uh it it verifies basically that
- 7:01it's connected. It says Figma is
- 7:02connected. Let me load the Figma tools
- 7:04and pull your design.
- 7:06It pulls up my design,
- 7:08right? And then
- 7:10uh Figma MCP server is connected. Uh
- 7:12tools haven't loaded, so it's going to
- 7:14load the tools,
- 7:16right?
- 7:17And it needs a full restart, not just
- 7:19MCP.
- 7:21So, basically you need to
- 7:23um
- 7:24just close the cloud and start that
- 7:26again, okay?
- 7:28So, once you've done that, it says
- 7:31everything is set up correctly. Confirm
- 7:32the server exposes these two
- 7:35tools, which is get Figma data, which
- 7:37reads your files layout, styles, colors,
- 7:39text, and then download Figma images,
- 7:41which exports the image and image icon
- 7:43assets.
- 7:44Okay, and then setup is complete. One
- 7:46step left. Figma MCP server added.
- 7:49Server connects. Tools exposed. The only
- 7:52thing we need to do is restart the
- 7:54session. So, I'm just going to close the
- 7:56cloud and then
- 7:58open it back again.
- 7:59When I restart, it's saying that it's
- 8:01going to do XYZ things, which is
- 8:05fetch the node from the file get Figma
- 8:07data. It's going to download the image
- 8:09icons scaffold classic WordPress theme.
- 8:12And it's also asking me to give it a
- 8:14directory where it wants where I want
- 8:17the theme to be installed. So, it's just
- 8:20saying just give it the path.
- 8:22And then go ahead and restart the cloud
- 8:24and and let it know. So, I've using use
- 8:26the exit to exit it and I've resumed the
- 8:29session.
- 8:30And then I've said that pull my Figma
- 8:32design and build the theme in this
- 8:34folder and call cos barrel.
- 8:37It says Figma tools are now available.
- 8:40It's loading
- 8:42them up to pull my design. Both tools
- 8:45are loaded.
- 8:47And then
- 8:49it's also picking up that it's landing
- 8:51page title. So, it's actually got the
- 8:53access of the
- 8:55design. So, if I go to the design, you
- 8:57can see this is the landing page we
- 8:59have.
- 9:01Right? Um
- 9:03and it pulls the broader structure. It
- 9:04says file is large.
- 9:07It sees the real design, right?
- 9:10And then I instructed it to say that
- 9:13only do the landing article and about
- 9:14because of course
- 9:16currently I don't want everything to be
- 9:18built up. So, just want it to do the
- 9:20landing article and about.
- 9:23Uh so, it says got it, confirmed. Just
- 9:26landing and about and let's keep doing
- 9:29its thing.
- 9:30Right? Let's keep moving.
- 9:33It has pulled design.
- 9:36Uh design tokens. So, it has pulled up
- 9:38that
- 9:40font is enter, color
- 9:42uh
- 9:43typography, buttons, layout. Everything
- 9:46is pulled up from Figma, which is great,
- 9:48right?
- 9:49If I click on that, you can see that
- 9:51it's 1440 over here, right? 1440. That's
- 9:54what it's picked up.
- 9:56Padding and everything is picked up from
- 9:57there.
- 9:59And it's building the theme.
- 10:01functions.php,
- 10:03header, footer.
- 10:05And
- 10:07now the landing page front page.php,
- 10:10single.php,
- 10:12about,
- 10:14index page.php.
- 10:16All templates are written. All templates
- 10:19are written.
- 10:20Now it's validating.
- 10:22Looks like it's built everything we
- 10:24need, uh like style, functions, header,
- 10:26footer, front page.
- 10:28Everything's been set up.
- 10:30And then all it's asking me to do is
- 10:32activate the theme,
- 10:34right? What I'm going to do now is just
- 10:37check what it's done. So, if I go over
- 10:39here
- 10:41and I check
- 10:42my project,
- 10:45I can see that it's created this Cost
- 10:47Peril theme here, and it's created all
- 10:49the files.
- 10:51I can see this is my style.css.
- 10:54And [clears throat] it's created these
- 10:55these um
- 10:57CSS custom variables for
- 10:59the theme colors, the radius, the
- 11:02container size.
- 11:03And it's added all the styles into it
- 11:06from that Figma. It's using the CSS
- 11:08variable, that is great.
- 11:10Later on I can ask ask it to move the
- 11:12CSS variables to the theme.json file,
- 11:15but
- 11:16this is very good for a start.
- 11:18And uh as you can see, it's also using
- 11:21BEM uh to style, even though I didn't
- 11:24ask it to, but it's following the best
- 11:26practices, which is great. It's also
- 11:28added comments and stuff.
- 11:31That is fantastic. So, these are all the
- 11:33styles, not much, just 680 lines of
- 11:36styles. Now, let's take a look at
- 11:38index.php, so you've got your header,
- 11:42your footer,
- 11:43and then you have section container,
- 11:46all of that stuff.
- 11:47I'm very curious to see the front end,
- 11:49how it's going to look like. So, let's
- 11:52go to the front end and we'll come back
- 11:53to and and read more about the files.
- 11:56Okay, great. So, I can see it created
- 11:58the theme called Cost Pedal. I'm going
- 12:00to activate it.
- 12:03And I'm going to go to front end and
- 12:04let's see how close it is to the design,
- 12:07okay?
- 12:09Ready? 1 2 3 boom.
- 12:13All right.
- 12:15Well, this doesn't look too bad.
- 12:18Let's compare it with the design.
- 12:20So, if you open it,
- 12:23landing page, this is my header. Looks
- 12:27good.
- 12:28Landing page title, the structure is the
- 12:30same.
- 12:31Yep.
- 12:33Spacing also looks same. This is the
- 12:35image, which is great. It's written
- 12:37that.
- 12:38Then you've got the section heading.
- 12:41Yep, exactly that.
- 12:43Size also looks correct. Uh section
- 12:46heading,
- 12:48another one, looks absolutely right.
- 12:52Then this section.
- 12:56This one, this one I'm not sure. I think
- 13:00this one it couldn't get it, but that's
- 13:02okay. It already gave us a warning that
- 13:05it's not going to be perfect, but it's
- 13:07very close.
- 13:09Uh this one,
- 13:12let's see.
- 13:14Yeah, not bad, not
- 13:16not completely as it is, but not bad.
- 13:18So, only these two sections it wasn't
- 13:20able to
- 13:21do. Uh this one,
- 13:24yeah, exactly that.
- 13:26And then the footer
- 13:28footer is slightly off.
- 13:30It couldn't get the footer right, but
- 13:32that's okay.
- 13:33We can fix that. And let's take a look
- 13:35as to how
- 13:37it looks on the mobile.
- 13:39Even though we didn't give it the mobile
- 13:40view, but you can see
- 13:43not bad, right?
- 13:45The mobile it's also responsive.
- 13:49And that is pretty good.
- 13:52So it's actually got the grid system in
- 13:55place.
- 13:58That is great. And if you go to mobile
- 14:00view
- 14:01it's also got the
- 14:04hamburger menu working, which is great.
- 14:07Perfect.
- 14:08Now let's go to
- 14:12Is there any JavaScript? Yeah, it did
- 14:13write the JavaScript also. It looks like
- 14:15it
- 14:16wrote the JavaScript for
- 14:19um the navigation toggle, which is
- 14:21great.
- 14:23Um
- 14:24and then
- 14:25it's got header.
- 14:28It's using the WordPress functions,
- 14:29which is brilliant.
- 14:31Using WP_Nav_Menu, which is great.
- 14:34And then the footer
- 14:37Okay, it's following the WordPress
- 14:39uh templating structure
- 14:42and the WordPress functions with the
- 14:44proper escaping,
- 14:45which is great.
- 14:48It's got the front It's got the front
- 14:50page.
- 14:53Right? Looks good.
- 14:57And then the functions.php looks like
- 15:00it's added the theme support for title
- 15:02tag, post thumbnails,
- 15:04custom logo.
- 15:09It also registered the nav menus, which
- 15:11is great.
- 15:14And it's using those nav menus. It's
- 15:16enqueued the fonts, the styles, the
- 15:19fonts from the Google fonts.
- 15:21Um
- 15:22and then the scripts, it's perfect.
- 15:26And it's got the base.php, so it's
- 15:29maintained the WordPress the loop. It's
- 15:32got the commenting.
- 15:34And it's got the single.php also for the
- 15:37post.
- 15:40Right?
- 15:41Looks pretty good, actually.
- 15:44Amazing. Isn't that amazing?
- 15:45So, within like a few minutes it was
- 15:48able to
- 15:50convert your Figma file
- 15:53into an actually running theme.
- 15:55Okay, now we're going to check the
- 15:56article page, so I'll go to the post.
- 15:59And let's view this one.
- 16:01Okay, and let's try to match it with the
- 16:03design.
- 16:04So, article or post title.
- 16:07Very close, although the alignment looks
- 16:09up slightly different, but very close.
- 16:12Then I should have these two.
- 16:17Nope, that's not there. That's all we
- 16:19always because that comes from the
- 16:20content, right? So,
- 16:22that won't be there.
- 16:23Does it have related posts?
- 16:25Yeah, it has related posts. That is
- 16:27great.
- 16:28Comment is not mentioned here, although
- 16:29it's added it. It doesn't know how to
- 16:31style it, so it's fine.
- 16:33And then
- 16:36So, I would say not bad. It has actually
- 16:38given us a starting point. It makes made
- 16:40our job easier.
- 16:42Now, all I have to do is just go and
- 16:44tweak things that are and you basically
- 16:46just fix things that are not in a way
- 16:49that I aspired to be.
- 16:51Brilliant. So, I hope you did like the
- 16:54video. If you did, please give it a
- 16:55thumbs up and do subscribe to my channel
- 16:56if you aren't already. And I'm going to
- 16:59see you in the next video and build some
- 17:01really cool things. Bye-bye.
About this transcript
This page contains the full transcript of Convert Figma to WordPress Theme using AI | Claude Code + Figma MCP Server for Design to Code by Imran Sayed - Codeytek Academy, generated from the public captions YouTube serves with the video. The transcript has 2,517 words across 460 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.