• ClassifiedPancake@discuss.tchncs.de
    link
    fedilink
    arrow-up
    13
    ·
    11 hours ago

    It helps to avoid the specificity problem. You don’t have to manage a complicated class system, you just set styles directly on the elements. Yes this is pretty much what everyone agreed in the past was the worst thing to do but that was before things like CSS variables existed (which Tailwind uses excessively) that lets you control details like color and fonts from a single point. So you don’t have to go through every component to change the brand color.

    At work we don’t use Tailwind often but in our React apps we mostly use Theme-UI which lets us write regular CSS on each element in a nice JSON format instead of the class name hell that is Tailwind. This is my preferred way.

    • 5opn0o30@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      9 hours ago

      This is very informative. I avoided Tailwind for the reason you mentioned, but look closer now that I know the difference.

      • ClassifiedPancake@discuss.tchncs.de
        link
        fedilink
        arrow-up
        2
        ·
        8 hours ago

        I think it’s especially great for smaller apps/sites or prototyping. Setup is quick if you’re already comfortable with CLI tools and configs. Or if you just want to get started immediately with no setup, just add a script into your site and when it needs to go into production later you can still do the setup process for a robust build.

      • 0x01@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        6 hours ago

        Tailwind uses css variables, it’s really nothing more than a bunch of helper classes on top of css, it’s not a replacement or anything.