(no title)
Phillips126 | 4 years ago
As a fan of tailwind, I can say that I initially thought this was dumb and it would be hard to read through a huge number of classes applied to each HTML element. Later, I found that for many of my reusable components, I could combine classes into a single class. As an example, my stylesheet may look like this:
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
.button {
@apply text-2xl p-2 bg-gray-100 text-gray-600 border border-gray-200 cursor-pointer hover:bg-gray-200 hover:border-gray-300;
}
}
I can now just give all of my reusable buttons the ".button" class instead of the giant string above.
zkldi|4 years ago
mcluck|4 years ago
I'm building an app like this right now and it's been lovely.
e12e|4 years ago
It's not so much about what you do as a single designer on the initial design, more about what a team of designers do when adding new apos/modules to an existing product.
In theory you could use bootstrap and a theme - but your fellow team members will get lost, re-invent some styles etc.
I'm inclined to solve this problem with discipline and corporal punishment - but I'm afraid the tailwind-people are on to something.
Basically the cascading part of css does not work well for applications / a suite of applications - it works better for actual hypertext documents (like sgml might) - where you can make a layout that works, while the browser handles the user experience (UX). When layout/design becomes "just" part of how an app looks, but the important is how it beheaves (including things like hover, expanding menus etc) - bare CSS doesn't work as well. Not technically, but from a perspective of an evolving code base.
wishinghand|4 years ago