Watch on YouTubePlayPlays from YouTube. Google's privacy policy (opens in a new tab) applies.
Adam explains Tailwind's classes as Figma properties, then has Claude link the app's colour tokens to Tailwind's palette, the way they're linked in his Figma file.
What you'll learn
- Plain CSS classes live in a separate file and pile up; Tailwind puts styling on the element with ready-made utility classes.
- Tailwind classes map to things designers know: text size, text colour, flex = auto layout.
- Tailwind ships colour scales (50–950, e.g. stone, zinc, gray) you can reuse as Figma variables.
- Semantic tokens in code should reference the palette, not raw hex values, just like in Figma.
- @-mention a file to point Claude at it, and state the problem plainly.
- Check Claude's fix and push back when it's only partly right.
- Lower the effort for small fixes; stay in the same session while context is low and the topic is the same.
Chapters
- 00:00Why designers need Tailwind
- 01:39Styling with a plain CSS class
- 03:29Tailwind classes on the element
- 04:36Tailwind's colour palette in Figma
- 05:54Asking Claude to fix colours
- 08:36Importing Tailwind's full palette
- 00:00In this lesson, let's talk about Tailwind, one of the most important frameworks in modern front-end web development.
- 00:07So, regardless of the text stack that you're going to use or you're going to find in any modern web application, chances are you are going to see Tailwind being
- 00:18used in here. And I believe even though Claude is going to be writing most of the code most of the time, it is still quite beneficial for us designers
- 00:26to have a basic understanding of, you know, what it is and what it does.
- 00:31So, in the previous video when we like did a brief walkthrough of the, you know, folder structures and some of the files in our freshly created Next.js application, we
- 00:42have already touched upon some Tailwind concepts and we have seen some Tailwind classes.
- 00:48But going back to the basics, let me actually go into my Chrome and I'm going to just type in Tailwind css.com.
- 00:57And this is the website that you can use to learn more about what it what Tailwind is and you can go and check out their documentations if you really
- 01:05want to solidify your understanding of how it works.
- 01:10But at a very basic level, when you work on a web applications, when you want to, you know, let's say make a text have a very specific kind of
- 01:20styling, you would want to use CSS to define it first.
- 01:24And traditionally, I would have a file such as index.css or theme or style.css.
- 01:30Doesn't really matter what name we use as long as it's a CSS.
- 01:34And over here, if I wanted to, for example, let's see, have a title of the page, a very specific kind of style, I would first do a dot title.
- 01:47This creates a CSS class and then I can define its properties just like this.
- 01:53So, starting off with the font family, we use Miranda Sans, which is available on Google.
- 01:59Um, I give it a color and type in hex value.
- 02:03I can give it a font weight of bold or I can use numbers to define it.
- 02:08I can do line height which I can, you know, define in, you know, uh, pixels.
- 02:14And then, of course, uh, font size is pretty handy.
- 02:18Uh, I can define it just like this.
- 02:20And then if I wanted to use it, um, I would have to go into, let's say, our components gallery page.
- 02:27So let me open it up again, components gallery page.
- 02:31Reminder, this is something that my Claude decided to do proactively.
- 02:34This is not part of the original Figma file.
- 02:37And if I wanted for this title to look just like this, I would have to, just like the class that I just defined, I would have to find it
- 02:44here. And, um, basically type in h1 class name and then just use title.
- 02:52And you can probably see from here how it can get pretty, uh, pretty ugly pretty quickly because what it means, I mean this kind of approach, is that, um,
- 03:02the styling of our UI elements is pretty heavily detached from where these elements live.
- 03:10Um, so if I now wanted to like change the way this looks like, I would have to go into a whole different file and this file would would pretty
- 03:17quickly start accumulating plenty plenty of, uh, CSS classes which would be very tricky for us to maintain.
- 03:25And we, you know, if we think about it, we already have older components in, you know, modern UI design, uh, that sort of address this problem.
- 03:33We use components and we use variables.
- 03:37So what Tailwind does is it creates plenty of what's called like utility classes and it generates them from for you so that instead of defining elements in an abstract
- 03:48place such as this global CSS file, you can do it directly where you define your elements using classes that are already created for you such as the text 5xl
- 04:00or text sm. This is a special Tailwind class which defines a font size and a um and a line height as well, I believe.
- 04:09Um then you can use something like text content default.
- 04:12If you know Tailwind, then you know this is a class that defines a color of the text.
- 04:17And then if you want to have a flexbox or auto layout which is a concept in Figma, but like in CSS it's it's a flexbox, you can define it
- 04:25using using again just a couple of different CSS classes.
- 04:29And this styling lives exactly where your like real UI elements are.
- 04:35And this is what's what is so cool about Tailwind.
- 04:38Now, you might remember from our brief walkthrough of the like the the Figma file which we use for this project that when setting up my variables uh specifically the
- 04:50semantic variables for backgrounds, content colors, and border colors, I have actually referenced Tailwind values rather than typing out my own um my own hex values.
- 05:02This is because Tailwind already comes with a pretty nice color system which we can borrow and get right into it.
- 05:11So each color scale has ranges that go from 50 to 950 and we can have plenty of very different colors including you know color scales for these you know
- 05:26gray or neutral colors.
- 05:28We have zinc which is more you know I believe it's it's it's a little bit warmer.
- 05:34We have gray which isn't really gray.
- 05:36It's more of a like a blue tinted gray and what not.
- 05:40And I wanted to use these rather than typing you know hex codes manually because this way if I ever decide that let's say my muted background is a bit
- 05:50too light, all it takes is just changing like swapping the variable from Tailwind's stone 200 to Tailwind's stone 300.
- 05:59The problem is my clot if I now go back to uh this file here.
- 06:06My Claude carried my Figma variables into implementation using like raw hex values, and I wouldn't really like that.
- 06:15I would want my Claude to uh actually define these using um you know just referencing Tailwind variables just like I did in Figma.
- 06:25So in this video I'm going to try to fix that really quickly.
- 06:29And I'm going to close out from the file picker uh and I can see this original session which we used for the initial implementation.
- 06:37It still has pretty uh like quite a lot of context window left.
- 06:42We have only used 24 %.
- 06:44And because it's kind of a fix that really um relates to that first initial implementation, I think it's an okay thing to like ask Claude to fix it right
- 06:55in this session as opposed to starting a new one.
- 06:58And why would we want to start a new session?
- 07:00This is something we're going to to be covering in future videos.
- 07:04So um I'm just going to I'm just going to uh let's see.
- 07:09I'm going to reference the globals file.
- 07:11I'm going to type the at symbol.
- 07:13I'm going to type in global CSS.
- 07:15This allows me to just make sure Claude knows specifically which file I mean.
- 07:19And I'm going to state my problem.
- 07:22Um Claude it seems like my um semantic color variables uh which you defined in the global CSS files are defined in raw hex colors.
- 07:36Whereas in my original Figma file I have used um or I have referenced uh Tailwind's colors um for my background border and contact color specifically.
- 07:50I've been referencing um the stone Tailwind color palette.
- 07:55Can you look it up and fix it for me please?
- 08:00Okay, let's see. Um just quickly scan skimming through the text.
- 08:05Um mhm mhm mhm.
- 08:08Stone Tailwind color palette.
- 08:09Great. Okay, before I send it, because it's a more lightweight kind of a ask, I'm going to change the effort back to medium because I don't really need high
- 08:19for this. It would take just a little bit more time for Claude to process it, and I don't think this kind of a request really needs to be handled
- 08:26by by a model with a high reasoning effort.
- 08:30So let's see what Claude is going to do in order to like inspect the situation and come up with a fix.
- 08:39Okay, and I can see my global CSS file is starting to look a little bit differently, and Claude has fixed it, but only partially.
- 08:48And this is something that I really want to be careful that we get right the first time because what it has done is it has redefined these Tailwind variables
- 08:58here in our theme of our global CSS.
- 09:02And I don't think and then yes, it has referenced those correctly here like to define my background, border, and content.
- 09:11So this part is right, but this part I don't really like.
- 09:15I don't like Claude redefining the Tailwind color palette even though we could just import it straight from Tailwind.
- 09:24And because pretty sure that this application is going to evolve over time and we might need to use different color from the Tailwind palette, not just the ones that
- 09:35I happen to be using right now today, I'm going to ask Claude to instead of like redefining color Tailwind color palette by hand so that it actually imports it.
- 09:49Thanks, Claude. I noticed that you have redefined Tailwind colors manually.
- 09:56Instead, I would like us to actually literally import these colors from Tailwind.
- 10:02It is important because in the future it is possible I'm going to be referencing other colors from the Tailwind color palette, and I would like to have access to
- 10:11all of them, not just the ones.
- 10:14Okay, let's see. Uh the dictation has lost the connection.
- 10:17Let me try that again.
- 10:19Uh okay, thank you Claude.
- 10:20Uh it seems like you have redefined um Tailwind color palette and instead I would like us to actually import it because in the future it is possible I'm going
- 10:30to be using many more colors from Tailwind, not just the ones that I happen to have in Figma today.
- 10:39Okay, seems like dictation is a little bit tricky now right now.
- 10:43Let me type it in by hand.
- 10:44Okay, my prompt is ready.
- 10:46I'm going to hit send and let's see what it does about this situation.
- 10:52Okay, I can see uh like the manual definitions are now gone.
- 10:56Uh the manual definitions of Tailwind um color palette is now gone and yet we still use uh proper vari Tailwind variables such as color stone 500.
- 11:08Um and let's see.
- 11:10Your semantic tokens now point straight at Tailwind's built-in palette instead of copied uh instead of copies of its colors.
- 11:17I check the browser and the app still looks the same.
- 11:19Wonderful, this is exactly um this is exactly what I wanted.
- 11:24Uh so let me go back here.
- 11:27I'm going to refresh my browser just to see.
- 11:30Yeah, everything seems to be looking looking nice.
- 11:34So um so yeah, seems like uh this problem has been fixed now.
- 11:39So that is basically uh the most like these are the basics of working with Tailwind.
- 11:46Um I highly encourage you if you ever want to to uh go and give Tailwind's documentation page a shot in case you want to learn more about like how
- 11:57you can use these uh classes to actually like start defining your components like the the their visuals uh manually.
- 12:05I'm saying this because sometimes it's just a little bit quicker and easier to uh change the size of the text by doing something like this rather than asking Claude
- 12:15to do it. Um and with that I'm going to see you in the next video.
- 12:19Thank you.