Brian: And okay. Hi, I'm Brian. That's Josh. Welcome to PodRocket. How's it going? Josh Comeau: Yeah. Hi, it's going well. Thanks for having me here. Brian: Thanks for being here. Tell us about yourself. I do this with everybody. There's no way I can intro you better than you can intro yourself. So by all means. Josh Comeau: I wouldn't be so sure about that. I'm terrible at introducing myself, but my name is Josh. Brian: Okay. Josh Comeau: I'm a software developer. I've worked for organizations like Khan Academy, DigitalOcean Gatsby. In the last year, year and a half I've left that IC work to pursue starting my own business. So I've been creating educational content for developers, like a CSS course that I just created. Brian: A CSS course is your... That is a bold move. Josh Comeau: It is. The thing that gets me in trouble when I tweet the most is when I talk about CSS. So it was definitely a bit of a fraught thing, but I really wanted to teach CSS because I noticed as... And so my CSS course is called CSS for JavaScript Developers. A very boring title, but I think it summarizes it well because I do think that there are so many JavaScript developers who are front end developers are people who work with frameworks like React or Vue or Angular who never really took the time to really learn CSS. We all pick it up as we go. We get it maybe, like if you go to a bootcamp, you do two days of HTML CSS, and then you're just expected to slowly build on that throughout your career. Josh Comeau: But CSS is a difficult language to do that with because there's all kinds of implicit secret mechanisms, just doing their work under the hood. You write three characters or more than that, three statements, display flex and all this stuff happens. It changes how the layout is totally being calculated. And there's all these little mechanisms behind the scenes. And as someone who was a JavaScript developer, who didn't really feel that comfortable with CSS, it really changed my entire front end workflow after I took the time to really figure out what the heck was going on down there. So, that's my... I had a few things I wanted to cover. I have the most experience teaching React, because I've taught at a bootcamp and I created the React curriculum for that bootcamp, but there's already so many good React resources out there. I didn't really feel like there was very much for CSS that was specifically targeted for people who were primarily JavaScript developers. So yeah. Brian: I feel like if we... It's a much longer conversation, if we talk about why it's hard or confusing or I don't know, maybe debating the very nature of CSS. That is one thing, but what are the... We could talk about it. But I think what I'm interested in now is what is it that when you were... What were you working on or what were you thinking about was like, "Okay, I need to get out there and actually teach CSS because this is a problem." Josh Comeau: Yeah. Well that's a good question. I don't know that there was any single thing. When I would teach at the bootcamp, I would notice that you get to the final weeks of the bootcamp and students will work on their final projects. And as much as people tripped over JavaScript, I noticed people developing those muscles of like, "Okay, you get an error message. You Google the error message. You learn a little bit more about what JavaScript is like. And then the next time you had this problem, you remember some of that." With CSS, people plateau really early. And I think it's because, and this... I'll give you the cliff notes version of why I think CSS is hard to learn. There's no error messages, there's no console, right? If things don't do what you expect, there's no information about why they don't do what you expect. Josh Comeau: And so much of it is implicit. With JavaScript, there is a certain amount of it that is implicit. But mostly you write the code, the code executes, you get an output, right? The CSS, we often focus on these properties. You learn what position absolute does or what z-index:4 does. But those two properties are just inputs to a layout algorithm that most developers don't really understand. So you learn like, this is how this property can tweak things in this algorithm, but they're just inputs to a function, right? CSS will use that data to calculate the layout. But often we don't really take the time to learn what that layout calculation is all about. Brian: I guess what I'm curious about then is, how do you think about CSS versus JavaScript, right? How are you thinking about how best to use it? How best to learn it? Maybe use it is not really that useful, which is funny to say. How do you think about learning it? Are there different ways to go about it? Or is it just like anything else? Josh Comeau: Yeah. So the biggest thing that I did in my own work that really helped was, like you're going a long, you're chugging along. Everything's good. And then you throw a couple CSS declarations in and they're the same... You have maybe this go-to pattern that you've used over and over again, you throw it in and it doesn't do what you expect. Right? You would use position absolute top zero less zero and the box isn't in the top left corner of the screen where you expect it to be, or you put z-index:5 and it's still somehow below something that has z-index:3. Right? I used to get into these situations and try to get myself out of them as quickly as I could. So you Google, you try to be as close as you can with your Google search. You just copy paste things on Stack Overflow and the moment it does what you expect and you're, or maybe you just give up and say, "Okay, well I can change the layout to meet this new constraint that I don't know how to solve." You move on with your life. Josh Comeau: What I started doing was like settling into this uncomfortable situation as if it was a nice warm bath. You just say, "Okay, I'm going to stick with this problem until I understand what is going on here." And often that would start by me, just experimentally trying things like what if I change this value? What if you delete the value and then you just press the arrow key to go through the different possibilities that CSS, the dev tools will suggest for you. So what other values can I put into this property? Sometimes that takes the form of going to the MDN documentation and trying to see like, what does MDN the source of all truth know about this given property and what pieces of that am I missing? Sometimes like more recently, the last couple years I started just going to the specification, which for a long time, I was intimidated by because you figure the specification is not really meant to be read by people like me. Josh Comeau: It's meant to be used by the browser integrators who need to actually build out their implementation. But what I've discovered is that the specification is actually great. Especially the flex box specification is the one that I've spent the most time in. And you learn so much about how the language at least is supposed to work. There's always that risk that browsers will have not implemented it exactly to spec. I've been bitten by that, the perspective property bit me with that recently. But in general, the CSS specification is this golden source of information and you can... I just have that experience going through it of like, "Oh, that's why this weird behavior actually isn't weird." I have an example which we'll see if I can describe this because it's hard to talk about something so visual. Brian: Yeah. Josh Comeau: Let's say you, that you put overflow auto on something, or let's say that you put overflow-y :auto on something. Josh Comeau: So what you want is that if the thing goes below the bounds of this rectangle, you get a vertical scroll, right? You can scroll up and down, but then you notice if I push something outside the horizontal bounds, right? So I have something that I push off to the left all of a sudden, I can scroll in both directions and I never set overflow-x to auto. I can put overflow-x to visible, which is supposed to be the default value and yet I can still scroll over to the side. And the reason for this is that you can read the specification to learn how scroll containers work, which is what is created when you use the overflow property. And what you learn is that what you've essentially done is created a box that things can't leave this box, right? Josh Comeau: You have now created this condition where anything that leaves this box will be clipped by it. And then when you start to think about it, how would it work if it didn't work that way? What if something overflowed into the bottom right corner overflowing in both directions? Would I expect it to be visible horizontally, but scrolled vertically? It doesn't really make sense. Another little thing that I learned, the difference between overflow-auto and overflow-hidden, they both create a scroll container, but overflow-hidden removes the scroll bars. So either way you're doing the same thing. It's just overflow-hidden has no scroll bars, which is this fun little detail that you would only ever learn reading the specification. But just an example of it, the kinds of you have these discrete ideas in your head and they all start to snap together and the entire puzzle, you can start to see the koala in the puzzle kind of thing. Brian: I think that's a great point. And I wonder like, even just that one little pearl of wisdom, that you only learn that and you didn't go looking for that. That's not something that you were... You just like I... Because if you had, of course, if you were looking for that, you'd never be able to find it easily. Yeah, I see that a lot or have seen that a lot with CSS. It's hard. I wonder, what is the end goal? In your opinion, what should the average dev? What should they aim for when it comes to CSS knowledge? Yeah. Josh Comeau: Yeah. I would say that there is absolutely, and I feel sometimes I get a little carried away and I make it sound like CSS is completely intuitive and completely knowable. It's tricky, right? CSS is definitely a tricky language. And that, I think comes down to two things. It comes down to the fact that... And this is what JavaScript too, we really value backwards compatibility. So rather than, if we were to design CSS today, we would do things very differently. We're hampered by the fact that we started with it in flow layout as this document. We gave developers the tool to build word processor type of things, like documents. And now we've built on top of that in increments. The other thing is just that we have so many different devices. Responsive design is such an inherently tricky problem and every device is going to implement the specifications slightly differently. Josh Comeau: So there's always going to be, I don't know if it's realistic to feel so comfortable with CSS that you never stumble over it, but my goal and where I feel I've reached after a few years of really being intentional about this is to have a complete enough mental model that I never feel my day is going to be way laid by some really frustrating issue. I feel like I have the tools but it's not always going to be smooth sailing, but when I do hit something that doesn't really make sense. Actually, I get excited when that happens because it means that I can add another piece to my mental model. Right? My mental puzzle is starting to get a little bit clearer, but I would say that it's been a very long time since I felt my day was ruined by the inconsistent feeling of CSS getting in my way. Josh Comeau: So I think it is totally realistic to try and shoot to become in a place. Not totally unlike when you get really comfortable with JavaScript, right? Where you're still going to get weird errors, but you never feel lost. You always feel like, "Okay." Well, mind you. There are still times with JavaScript. I feel lost especially when we start, I dealt with some weird web package issue today that that's just the whole thing. But in the same, I've been using React since 2015 now and I feel pretty comfortable with it. It's rare that React throws me for a loop. And I think the same thing can definitely be true of CSS. Brian: I'm thinking in trying to think if I... I don't know what it is. Like, there's something... And maybe it actually goes back to being hampered by when CSS was created. Right? That maybe makes sense to me. What it is about it that just seems too, what's a diplomatic way to put it? Vex people and then... I mean, you said people's days are ruined by CSS and there are hundreds of memes out there to confirm that. You don't necessarily see that with JavaScript or, I mean, believe me, you do see it but not as much. I don't know. So there's that, and I don't purport to be an expert in any way on whether one is better than in another. Brian: But yeah, I do think that there's a specific kind of person who gets really excited about pulling CSS apart. And what I mean by that is, you're already talking about it like it's a puzzle. You're already talking about it like, I'm going to read all of the documentation, figure out what is going on here to solve this problem. And I wonder if that is a requirement for being considered an expert at CSS and who cares if you're even considered an expert, just a practicing at CSS expert. Josh Comeau: Yeah. I mean, I don't even really know if I consider myself an expert. I feel like what I consider myself is someone who has filled in enough of a puzzle but I feel I can be very productive as a front end developer. And that's, that's the goal, right? I want to get people to have place with my course where if you go through this course and you absorb the stuff inside, you'll be able to chug along with CSS just as well as you can with JavaScript and maybe even enjoy it if you don't currently enjoy it, which I think is true for a lot of JavaScript developers. I think that it's... There's is a lot to it and I think it goes back a little bit to what we were saying before, where there's all of these concepts, like scroll containers, containing blocks, stacking contexts, right? Josh Comeau: There's all this stuff that you... I started writing CSS in 2007, 2008. So I spent almost a decade using the language without ever understanding these really fundamental concepts. And I think that's true for most developers. You have to go out of your way for that not to be true. Just because CSS is so implicit, right? We learn like CSS is such a magical language, right? And I mean magical in the same way that Rails is magical, right? You write a couple lines of code and all this stuff happens. And that's great when you're on the happy path and everything is coming together and you're going quickly, but then something happens and you're totally lost because you don't actually understand what's happening under the hood. I think the goal is to have enough familiarity with what happens under the hood, that when you do hit these strange situations, you have a set of tools you can use to dig yourself out of the ditch kind of thing. Brian: I want to take a step back from CSS itself and talk a little bit more about your journey, from individual contributor to instructor. And I asked about what do you think the kind of person, what the traits are, what the qualities are, whatever, because there's a much smaller group of instructors for CSS than JavaScript. So, let's start at the beginning. Tell me a little bit more about when you're like, "All right, I'm going to do this thing." Did you go out and look at the landscape and see where you could fit and all of that stuff? Josh Comeau: Yeah. So there is a backstory that I don't mind sharing. Hopefully it's interesting. In March of 2020, right? Right with everything was locking down, I injured myself, I hurt my nerve and it meant that it started that I couldn't really type with my left arm and then curiously, it happened to my right arm too. And I spent a few months where I couldn't really type. And as a software developer, that's pretty frustrating. You can't really do your job and I did. So what I did is I learned how to dictate, right? I have this microphone sitting next to me, which I'm not using, even though I probably should be, because I'm setting up a new computer. It's not working yet, but I had a microphone and I had an eye tracker and these two things together would allow me to write code, but it was slow. Josh Comeau: It's definitely slower. And it took a few months for me to get comfortable enough with that kind of routine, right? From not using my hands to write code that there was definitely a period in the middle there where I had this realization that my goodness I don't have forever. Right? As a software developer, we all have a finite amount of characters that we will type in our lives. And hopefully for most of us, that's going to be in the trillions. It's going to be some very large number, but it's still a finite amount. And so I started thinking like, "What do I actually want to do?" Right? I enjoy my job. I had a good job. But yeah, I liked this idea of following in the footsteps of people like Wes Bos and Kent C. Dodds and creating my own course. Josh Comeau: And so then the question became, what do I teach? And as I mentioned, I had a good amount of experience teaching React. I had been teaching at a local bootcamp for a couple years and it really was a matter of looking at myself and figuring out, "Okay, what..." I like the idea of having a lot of impact. Right? So I wasn't really, I mean, obviously I did factor in what I thought would sell, but my main concern was, what can I do that will have a tangible impact on the day to day lives of the developers that go through this course? Hopefully for a long time to come and CSS almost immediately stood out to me as like, "Oh obviously that," because first of all, it's not going away anytime soon. JavaScript frameworks come and go. Josh Comeau: Although, it does seem like React has settled in to be a pretty standard option. JavaScript itself. Right? We have web assembly now. Who knows, will I be writing UIs in Rust in a few years? But CSS, there is no a web assembly for CSS. And beyond that, beyond just... There's no way to do layouts on the web without CSS. You can come up with some fancy abstraction. That means that you're not writing CSS, but at the end of the day, the browser only understands CSS, right? Josh Comeau: Everything compiles and attracts away. It's also just the thing that, especially in my niche, right? In the JavaScript, Twitter community, it's the thing that I saw and you mentioned this too. That's what people complain about. Right? Every day you see someone who's talking about how CSS is making their life harder and having gone through a similar transformation myself, I thought, "Wouldn't it be cool if I could remove that pain from typical front end development and make people..." Especially because so many people are already comfortable with JavaScript and HTML, they are two thirds of the way there. Josh Comeau: If I can fill in that missing piece, you'll have the whole set. Right? You'll complete the trinity and then life will be glorious. So, that was the thought process at least. Brian: I like it. I mean you did touch upon a little bit is thinking about what would sell or at the very least like what do people really want? And especially when the trend is JavaScript heavy. Did you do any like... Was it just gut or were you doing any research or were you talking to folks? How did that work? Josh Comeau: Yeah, there was some informal. Brian: Yeah. Sure. Josh Comeau: Research really makes it seem like I'm much more organized than I am. I have a blog and I started writing more CSS posts and I noticed that my CSS posts like my most popular posts now are on CSS. I also noticed that on Twitter, like here's something people may not realize, when you add someone to a list. If that list is public, the person you're adding gets a little notification, "You have added so and so to your list X and the list is named." And I noticed that people started adding the... It used to be, I was always getting added to JavaScript and React. And I started getting added to CSS lists, which made me think that there is an app because I was still sharing JavaScript and Reacts stuff. Right? I was just mixing in a little bit more CSS stuff, but that's what seemed to be really what people were really into. Josh Comeau: So yeah, that definitely helped. That gave me the confidence to say, maybe this is worth burning through some of my life savings and spending a few months building something without any real promise that anyone would buy it. It did help to see that, oh, actually there is, at least for free content, there is demand for this. Brian: That's true. Do you feel like you'll run out? And it's similar to the question that I asked earlier is like, what's the end goal? If you're the developer and you should think, well, how much CSS is enough CSS for me to know? Do you feel like you'll ever... With the reverse problem, how much is enough to teach? How much is like, when do I stop talking about CSS? Does that ever enter your mind? Josh Comeau: Yeah. I mean, when I first started, I figured I would spend three, four months on this CSS course and I would churn out one or two courses a year and CSS would just be one part of that. Like, I'd have a React course. I want to do an animations course but A, I vastly underestimated how long it takes. It took me over a year of full-time work to create the course. Brian: Sure. Yeah. Josh Comeau: And B, I realized that there actually is still more I could do in this world. And CSS keeps changing, right? We're getting a bunch of exciting stuff. Like container queries are right around the corner, which is going to totally invalidate a whole module that I have, which is a good problem to have, because it means I'll get to remove all the, "Here's the weird hacky things you have to do to solve this problem. And now here's this nice new way. You can do it instead." Yeah. I mean, I think that I would like to do more than just CSS at some point, but I don't really worry about running out of stuff to do with CSS or with CSS. I'm okay with that being my brand now. If that's what people are looking for, then yeah. Brian: Yeah. No, and I didn't mean like, "Hey, when do you think you'll stop talking about CSS?" What I meant was for me when I was thinking about strictly JavaScript content, at some point I was like, "We will run out of thing. It'll be a very long time." But presumably unless... Frankly, unless front end keeps going the way it's going and becoming more and more complex, maybe we never will. But at some point they'll be like, "Okay, you know how to put a venue together, right?" In whatever framework is. Josh Comeau: So you're saying like... Now I think I'm clueing together what you were getting at. Brian: Yeah. Josh Comeau: Like how much is the average person need to know and what happens when you've taught that person everything they need to know, is that kind of where you're going? Brian: Sort of like, is there a thing where it's like, and I don't... There's no way to really quantify it, which is why I'm asking. Is there an intuitive way that's like, "This is probably enough. I think this is good." So you've got the holy trinity and then what? Josh Comeau: Yeah. I mean, I do think that the reason I like software development isn't because I like learning an ever increasing treadmill of additional ways to do things. I like building stuff. Right? One of the things that I... When people ask me, I get this question a lot, I'm learning to code, what project should I build? And my answer is always like, "Do something that is personally interesting to you outside of coding." So one of the first things I did, I used to yo-yo semi competitively and I built a tool that would with a graph, show me the distribution of weight, diameter, and width for a bunch of different yo-yos. And I used D3 and I had this fun little graph, that was fun. Right? I played Beats Saber, a VR video game and so I built myself a Beats Saber level editor using three.js. Josh Comeau: If you can find a way to connect this thing that you're learning to a separate interest or hobby that you have, it's so much more motivating. So yeah. I don't know that... There always is a new stuff to learn because things keep changing, but I'm not really worried about like what running out of things to teach or trying to figure out exactly where the threshold is of how can I tell if this person knows enough. My goal really is just to give people enough tools so that they can do these things and build the things that they want to build. If that makes sense. Brian: Yeah. Totally. Speaking of building things, do you feel pressure to execute perfectly given that you teach CSS and no matter what device, like everything should be wonderful. Do you feel that? Josh Comeau: It is funny because I get a lot of bug reports of very obvious CSS mistakes for the CSS landing page that I'm selling my CSS course on. It's always funny when someone's like, "Hey, you made this really obvious, basic mistake on the page that you're trying to use to show people why they should trust you to teach CSS." And I think that they're... All of us will make mistakes, right? That's inevitable. And what I have heard from some people, like often someone will come in... We use Discord as our community chat. And they'll say like, "Hey, you posted a solution video for this exercise. I found this other way to solve it, which I think might be a little bit easier." And I'll look and I'll be like, "Oh, you're right. That is a better solution." And I think people are always happy to see when I didn't immediately have the most optimized solution, because it shows them that we're all just learning and I think it gives people more permission to forgive themselves for the mistakes that they make. Brian: That's a really good point. I think it's one of the things that I frankly really like about the people who read the LogRocket blog, for example, like when an author makes a mistake, the vast majority of comments is like, "Hey, you made a mistake here." Like there's no one gets that upset or they have questions like, "Did I mess up?" I always tell the story. I don't think I've told it on the podcast before, but when I first started at LogRocket and I was at a trade show and somebody asked me, how does LogRocket, the product work? And I said, "Oh, instruments, the DOM." And the person and asked me, "Well, what do you do about the mouse?" And I was like, "Oh, that's part of the DOM." Brian: And they were like, "You sure?" I go, "I'm super sure that that's, yes. It's just doubled down on it." And they were like, "Oh, okay." So both of us walked away, I'm clearly wrong, but this person wasn't like, "You're definitely wrong about that." They were just like, "Maybe I'm wrong." Or they just were polite and don't want to tell me that. But, it was at the time I was... Then I went back later and I was like, "Oh, that was really nice of them." So anyway, that's a long commentary on me being dumb and, or at the very least ignorant. And then also just like, "Yes, web devs in general seem to be pretty... It's nice to see other people, who you think are perfect not be perfect." Josh Comeau: Yeah. No, I think that's exactly right. It is. I did spend probably three or four years. I think I mention, I alluded to this. I had a moment where I realized that I was just really frustrated with CSS being the thing that kept derailing me. I felt particularly frustrated when CSS would get in my way, because I just would've no idea where to start. Right? With JavaScript there are breadcrumbs you can usually follow. With CSS is just like, "My goodness, what do I do now?" And so we talked about this, like using MDN docs and specification and experimentation. It was a few years of doing that. Not full time, but just whenever I would hit a problem, I would spend a couple hours digging into it. And so, because I've gone through that, I do think that while I don't actually know if I consider myself an expert, like there are people like Jen Simmons who know way more about CSS than I do or ever will. Josh Comeau: Right? But I know more than the average JavaScript developer because I've had this experience over the past few years and that I think is useful to them. I also think there's something to be said for teaching someone, something that you yourself have learned recently because you have more empathy with what it's like not to know that's not something. It's not like you're so far ahead of where everyone else is that you have no recollection of what it was like. Not to know this thing. I'm struggling with just a little bit now because I want to create a design course and I'm not a designer. I design things, like people can look at my blog. I design that. And so I think I'm capable of producing a decent design, but I've never trained under that. It's just that I have, if you go to my GitHub, I have 250 repositories and the majority of those, right? Josh Comeau: Some of them are forks. Some of them like CLI tools, most of them are side projects that I wanted to build where I had to be the designer because I didn't have a designer on my team. And so in the course of doing a couple hundred projects, I learned... Also collaborating with designers. I do think what I mentioned with CSS, it's been a few years of me slowly getting a little bit further and further, but I'm trying to convince myself that that's okay. Because what business do I have teaching a design course when I've never worked as a designer, but I actually think I would have especially design for devs, right? I can put design in a dev context. I think it actually would be really helpful, but it is hard to shake yourself from the idea that the people who teach the course must be the top of the industry. There's no sense learning from someone that isn't at the absolute pinnacle of the thing that you're trying to learn. Brian: I'm going to ask you a cliche question, but I don't care because I'm the host of the show today. Honestly, where do you find the time to do all of this stuff? I feel like there's a lot going on between design, CSS, dev work, running your own business. Josh Comeau: It's definitely... Yeah. There's not enough time and I'm constantly in awe of how I can finish the day with a checklist that looks even more full than it was when I started. I think that the nice thing is that I don't have a job now. Well, I don't have a typical full-time job. I'm self employed so I can spend all of my time on these things. When I did work as a dev, it was... I look back now and it's no surprise that I developed a repetitive stress injury because yeah, I was putting in way too much time because I was doing a full-time job at Gatsby. I was teaching part-time at Concordia and I was publishing a new blog post every two weeks and working on my Beats Saver editor. It was a lot. I think that part of it is like, the nice thing is it was rare that I would say I'm pushing everything else aside. Josh Comeau: And today I am focusing on learning CSS or learning design. It was always in the process of doing what I was already doing anyway. So it's like I'm working on some new feature and rather than spend half an hour and shadowly throwing together the CSS. I'm going to spend an hour and a half, two hours on it. So you like squeeze in a little bit of time, which is in service to the thing that you're building anyway. Like you'll produce a better result if you do that. And design is the same thing. My favorite trick is when you're working with a designer, they send you the design, spend 10 minutes talking to them about it and see if you can develop an intuition for why they made the decisions that they did. Ask questions that are legitimately confusing to you. Josh Comeau: Like why are we using this font size here? And that font size over there? Why are we switching the color used on this element? Why do we choose twice as much space between the header and the H1 as we did between the H1 and the paragraph below? Those sorts of questions. First of all, designers are usually delighted to have these conversations, right? It's so rare for developers to take an interest in it, but it also makes you a way better developer because now, they give you the design, they go home for the day, you're hacking on it and you realize, "Oh, there's unspecify." Right? I like to say, we're always making design decisions because the process of implementation itself... Designs are a very primitive sketch of what the final product is and we have to fill in the gaps. Josh Comeau: So we have a mobile design, a tablet design, a laptop design. What happens in the spaces between those two designs or on really large screens or what happens when, unlike in the design where everyone has a name that is 10 to 15 characters long, we have a two character long name or a 35 character long name, right? Like there's all these inconsistencies, right? What happens when they view it on a browser that uses different native form inputs? There's all kinds of things that like we are making the design decision. And if we can develop a bit of that intuition where we understand the philosophy behind why this design is the way that it is, we can make educated guesses about those things. And we can make progress instead of shooting them an email and then being blocked, waiting to hear back or deciding that you'll work on something else. Josh Comeau: And then your context switching. It's just nice. And I'm not saying that we should all become top level designers. I'm just saying that that intuition a little bit goes a long way because now you can make these educated guesses. You won't always get it right. But you'll get it right more often than not. And that's enough to keep you moving forward. And first of all, you'll be the design team's best friend. I think it's so useful for just cultivating these good working relationships. There's also like... And I try not to lean into this too much because I do think that it's making something that shouldn't be self-serving, more self-serving, but developing that good relationship with design is good for so many reasons. Brian: Yeah. Josh Comeau: Let's suppose that design is asking you to do something that is surprisingly tricky. Let's say they want to have a paragraph that should truncate after three lines and show the ellipsis. This is actually easier now than it used to be. There's WebKit line clamp, but let's transport ourselves back in time where that was a really hard thing to do. Right? You could do single line ellipsis. You could do text-overflow: ellipsis, overflow-hidden. But if you wanted multiline ellipsis, you would have to get JavaScript involved and measure the pixel count and all of these things that were really difficult. Josh Comeau: And so if you don't have a good working relationship with design and you tell them, "Oh, this actually is very difficult." You're likely to get some pushback. And maybe like, you will be forced to do this thing that is harder than it should be. Whereas if you have this good working relationship, you can start a dialogue and explain why this is more difficult than it seems. And they will trust you because you have proven yourself to be a good team mate and they'll work with you to find an easier alternative. You can make your own development life so much easier by having this good working relationship. Brian: And it's a two way street, right? You can... Design becomes more aware of what's possible because they're having the same conversation as well. So everyone's time is saved a little bit, unless people feel like digging in, but usually it's like, "How do we get to the best product possible with the least amount of strife?" Josh Comeau: Yeah. Another, to that same goal, I find it so useful. When I worked at Khan Academy, I used to fly on the wall. I used to be a fly on the wall in the design meetings. And I don't know if this is how most design teams operate. I assume it is where a designer will work on a first draft of something. It might be, not even have any color, right? It might just be like a sketch. And then they'll bring that to these design meetings and they'll discuss it as a group. I would just pop myself in there. Josh Comeau: And then every once in a while I would be able to say like, "Oh, actually this thing that you're talking about has X and Y technical constraint that makes it like much more difficult." And they can adapt that way earlier in the process than they spent another three weeks debating the pros and cons and doing a high fidelity mock up. And now they're attached to this idea and then you're telling them it can't be done. The earlier we can get in and direct based on the technical constraints, just the easier it is for everybody and the more we can get done, really. Brian: You are relentlessly positive. And this was an awesome experience for me, really. I mean, I hope that I didn't give you the impression that I view CSS negatively. I'm always interested. Like whenever I see the Peter Griffin meme with the thing, I'm like, "Okay, there's got to be something under there that somebody has to figure out what's going on." So it was a real pleasure to have you on. This is the part of the show where I ask you if there's anything you'd like to plug and then, projects that maybe don't get enough attention or people or et cetera. Josh Comeau: Yeah. Well, first of all, just thank you for having me on. I'm always happy to come chat about CSS and this was absolutely a pleasure. So I appreciate that. The project I have the most enthusiasm for right now is Framer Motion. It's an animation library and I built a library called React Flip Move that attempts to do what Framer Motion does, but does it nowhere near as well or as comprehensively. And I am just in awe at what you can do with it, just to like... And again, hard to describe verbally something that is so intrinsically visible or visual, but essentially it allows you to animate properties that aren't normally animatable. So let's say I have a container and I have a set as like display flex, flex direction row, and I want to flip it to flex direction column. So instead of being aligned horizontally, they should be aligned vertically. Josh Comeau: Framer Motion can animate that. So the fillings will actually like move around and adjust to their new position. You can animate any property and it does it in the most hardware accelerated optimized way possible. And it's just, it enable so many cool things. Just an amazing project. I also really am a fan of Amelia Wattenberger blog. She does these really in depth, interactive blog post. She has one on the CSS cascade, which is impossible to over recommend. Yeah. Brian: No, I co-signed. Super cool. Very good. That's Josh Comeau go to... We didn't really... All of your stuff will be in the descriptions, where can they find you online? Josh Comeau: Yeah, I try to make it easy. So my Twitter is JoshWComeau. My last name is spelled C-O-M-E-A-U which I recognize is strange. Ends in three vowels and is pronounced like none of them, right? E-A-U and pronounced as O. So joshwcomeau.com is my blog. And you can learn more about my CSS course at css-for-js.dev. And it's spelled with the dashes like CSS and JS. So css-for-js.dev. Brian: Awesome. Go there. I take the course. Thanks again. See you later. Josh Comeau: Thank you. Brian: Thanks for listening to PodRocket. Find us at PodRocketpod on Twitter, or you could always email me even though that's not a popular option. It's Brian@logrocket.