Also, they have an impact on the bundle size because in JavaScript, it adds more JavaScript to sometimes a bundle that is already big if you have a lot of logic in your application. Also, the idea, when you want to deal with server-side rendering, it can add complexity. And all these trends led to something called headless components. That's a trend that I found very interesting over the last years. So, what are headless components? They are unstyled components, meaning they come with no style. You have to style them by yourself. But they come with a great built-in accessibility. When you think about accessibility, you can think about disabled users, but you also think about poor users, things like keyboard shortcuts, for example. All the details are hard to get right at first when you want to write them by yourself. So, these libraries, like we have ARIA, LSUI, Redux Primitives, help you create applications dealing with all these tedious aspects.
And now I want to talk about Tailwind CSS, because that's one of the current standards in web development. So, Tailwind CSS, you must have heard of that, use this atomic CSS approach. So, instead of writing styles in your CSS, you write them directly in HTML as attributes. So, there is no more CSS file. There is no more risk of conflict because of all the styles that can clash. It also helps getting a consistent design system because they have, by default, a very nice system. They provide, for example, a scaling space. They also have a great Dx, developer experience, if you use the right tools in the IDE. And there is something called build time optimization, meaning there is a process that ensures that you keep, you ship only the right amount of CSS into your browser. So, in a way, it's a solution to a lot of problems that I described very briefly previously.
Another reason why it became a standard, because of great documentation. Also, the fact that it scales very well, no matter the size of your application. Also, for developers, it's great to be able to reuse the knowledge that you have accumulated over different projects. And last but not least, there is a native community and a huge ecosystem. Something interesting is that there is this kind of love-hate relationship. Some people love, some people hate. We have to say that sometimes it feels strange to rely on string concatenation. I've included here a snippet from my own code base. This is the command key search box that you see on some fancy sites. You can see this huge class name.
Comments