Tailwind CSS is a versatile CSS framework that doesn't enforce a specific structure or method on your project. It consists of utility classes that can be applied flexibly to any HTML structure without being restricted by the framework's opinions.
For a long time at MarsBased, we dismissed the use of TailwindCSS for our front-end projects. The lack of its own component library along with the absence of a design system led us to conclude that TailwindCSS was not the best option for us.
Until now. Let's see why.
text-center
to center text, bg-blue-500
for a blue background, and p-4
for 4 units of padding.tailwind.config.js
) to adapt the utilities to the specific requirements of your project.sm:
, md:
, lg:
, etc.For a long time, we tried using Tailwind in closed environments and side-projects, to give it a try. Time and again, we were not convinced by the reasons above, mainly, so we decided against using it. I believe we first tried it in 2018, and have followed its evolution closely ever since. Considering it was first released in 2017, it was pretty early on!
Since its inception, TailwindCSS has evolved into a “syntactic sugar” language, making extensive use of PurgeCSS and allowing for much more complex utilities that are directly eliminated when not used, thus going against our company culture of "less is more".
A couple of years ago, we started using third-party component libraries such as Flowbite, PrimeReact, or NextUI, which have filled the space left by TailwindCSS. By using them, we have found their strengths and weaknessess too, and while some of them are pretty comprehensive and great to use, sometimes they are not enough for complex projects of the size we usually work on.
Therefore, TailwindCSS has become a good choice for projects where React is used and big teams work together at scale. Both because of React's own componentization that fits well with Tailwind's utilities and because these libraries meet many of the common needs of projects.
This is why we have recently started to use Tailwind more openly in our projects, after many years of testing it and tinkering with it in some client projects where it was already included, so we learnt the ropes in real environments.
TailwindCSS is perfect for a "utility first" approach and this is where we believe its potential lies. Combined with simple configuration and its system of functions and directives like @apply
and theme
, it allows us to use its utilities to create reusable entities and components needed in the project, such as titles, buttons, form elements, etc.
Find out how we organise in our frontend projects and the tools we use.
Leer el artículoTwo options for one of the biggest debates in the frontend world.
Leer el artículoAs our company grows, so do our projects and clients, and not all of them can be developed with out-of-the-box solutions. Thus, we created a bespoke frontend framework for ourselves.
Leer el artículo