Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Programmer Humor
  3. [ComiCSS] Benefits of Tailwind

[ComiCSS] Benefits of Tailwind

Scheduled Pinned Locked Moved Programmer Humor
programmerhumor
80 Posts 43 Posters 29 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • rushlana@lemmy.blahaj.zoneR [email protected]

    Genuine question : what's wrong with modern vanilla CSS3 ?

    Maybe it's because I've used css2 I don't see the point of css frameworks.

    trickdacy@lemmy.worldT This user is from outside of this forum
    trickdacy@lemmy.worldT This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #33

    People fear what seems foreign. Devs want css to be like a programming language and it's not so they're uncomfortable. Or at least this is my unvarnished opinion

    P 1 Reply Last reply
    2
    • 0 [email protected]

      Ngl I love tailwind, I've been through so many different css paradigms

      • separate css files: why did we ever do this, if you've ever used kendo's css stuff you'll understand how unfathomable hundreds of thousands of lines of css with complex rules is. Identifying all the things that affect a single component is the work of dozens of minutes at minimum, sometimes hours, you have to understand every nook and cranny of the css spec.
      • inline styles: fine, but verbose and requires object spreading, harder to compose, theming is tough and requires discipline to be consistent in your theme conventions, almost impossible to also theme imported library components
      • module.css with imported classes: my go to outside of tailwind
      • scss: I actually really like scss but it exacerbates the complexity and mystery of css, great for small projects but terrible as projects bloat
      • bootstrap: basically just worse tailwind, providing only components and colors

      That's all I can think of right now, but tailwind is my preferred way to style a new project, I love how easy theming and style consistency is

      J This user is from outside of this forum
      J This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #34

      Honestly, I'm still very much in the "classes define what a tag represents, CSS defines how it looks" camp. While the old semantic web was never truly feasible, assigning semantic meaning to a page's structure very much is. A well-designed layout won't create too much trouble and allows for fairly easy consistency without constant repetition.

      Inline styles are essentially tag soup. They work like a print designer thinks: This element has a margin on the right. Why does it have that margin? Who cares, I just want a margin here. That's acceptable if all you build are one-off pages but requires manual bookkeeping for sitewide consistency. It also bloats pages and while I'm aware that modern web design assumes unmetered connections with infinite bandwidth and mobile devices with infinitely big batteries, I'm oldschool enough to consider it rude to waste the user's resources like that. I also consider it hard to maintain so I'd only use it for throwaway pages that never need to be maintained.

      CSS frameworks are like inline styles but with the styles moved to classes and with some default styling provided. They're not comically bad like inline styles but still not great. A class like gap-2 still carries no structural meaning, still doesn't create a reusable component, and barely saves any bandwidth over inline CSS since it's usually accompanied by several other classes. At least some frameworks can strip out unused framework code to help with the latter.

      I don't use SCSS much (most of its best functionality being covered by vanilla CSS these days) but it might actually be useful to bridge the gap between semantically useful CSS classes and prefabricated framework styles: Just fill your semantic classes entirely with @include statements. And even SCSS won't be needed once native mixins are finished and reach mainstream adoption.

      Note: All of this assumes static pages. JS-driven animations will usually need inline styles, of course.

      1 Reply Last reply
      10
      • M [email protected]

        Tailwind is for people that don't know how to use CSS properly. There, I said it.

        trickdacy@lemmy.worldT This user is from outside of this forum
        trickdacy@lemmy.worldT This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #35

        And they hated him because he was right.

        1 Reply Last reply
        1
        • pro@programming.devP [email protected]
          • Permalink.
          • Source code.
          orca@orcas.enjoying.yachtsO This user is from outside of this forum
          orca@orcas.enjoying.yachtsO This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #36

          In my personal projects, I don’t use anything. I wrote a set of utilities and functions in SCSS years ago that let me easily create reusable variables and classes that already do what TW does, but with less bloat and overhead. I get project-specific spacing, colors, font classes, everything.

          I also highly recommend picking up Andy Bell’s Complete CSS course.

          1 Reply Last reply
          5
          • B [email protected]

            except we generally use higher level abstractions now, like component based frameworks. If you're writing raw html with tailwind and no library you're doing it wrong and css is a better fit.

            well written straight css ends up building it's own tree of components. if you're using react too you're either only selecting a single component (inline styles but have to open two files) or writing good css (duplicating the component hierarchy in css).

            tailwind is just the former but better since it encourages using a projectwide set of specific sizes/colors/breakpoints and small scope, the two actual problems with inline styles after organization and resuse, which react etc solves.

            trickdacy@lemmy.worldT This user is from outside of this forum
            trickdacy@lemmy.worldT This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #37

            I cannot tell if you're saying tailwind is taking away from useful abstractions or adding to them. I think it's taking away from them. A whole bunch of class names in the page is opposite to what we were taught and there was a good reason for the lesson: content and presentation should be defined separately. This lends flexibility, readability and accessibility. Tailwind doesn't help with anything but preventing a breakage in another component/page. To me the reason to value this trade off is that you don't want devs to "have to care about css" which is a bad sign to begin with. It says "we think the way the web is built is bullshit, so let's just try to work around that with the latest attempt to make it better". The web is not bullshit. CSS is beautiful. Embrace the challenge. (Sorry I'm only halfway directing this rant at you)

            pupbiru@aussie.zoneP B E 3 Replies Last reply
            3
            • M [email protected]

              Tailwind is for people that don't know how to use CSS properly. There, I said it.

              D This user is from outside of this forum
              D This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #38

              This is the correct answer. Pig-headed arrogance is why this cancer of a framework exists.

              1 Reply Last reply
              2
              • M [email protected]

                Tailwind is for people that don't know how to use CSS properly. There, I said it.

                L This user is from outside of this forum
                L This user is from outside of this forum
                [email protected]
                wrote on last edited by
                #39

                That's a common misconception by people who never used it. The truth is you need to know CSS to use Tailwind. Just because it simplifies styling doesn't mean it simplifies the underlying technology.

                pupbiru@aussie.zoneP 1 Reply Last reply
                4
                • pro@programming.devP [email protected]
                  • Permalink.
                  • Source code.
                  blackmist@feddit.ukB This user is from outside of this forum
                  blackmist@feddit.ukB This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #40

                  Which CSS framework is it that puts this shit everywhere?

                  That one can die in a fire.

                  E T 2 Replies Last reply
                  15
                  • pro@programming.devP [email protected]
                    • Permalink.
                    • Source code.
                    U This user is from outside of this forum
                    U This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #41

                    I've used raw CSS for the last 2 years at work and it's not like it's magically better or my productivity is higher or that it is simpler to read and understand.

                    Use the tool that works for you, tailwind is fine.

                    1 Reply Last reply
                    12
                    • P [email protected]

                      Having never used it before, is it that bad?

                      L This user is from outside of this forum
                      L This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #42

                      It's actually very useful. All these negative comments have the hallmarks of people who don't generally use it. I can tell because the criticisms stem from a lack of familiarity, missing the point.

                      1 Reply Last reply
                      5
                      • M [email protected]

                        Why Tailwind if you have CSS variables?

                        0 This user is from outside of this forum
                        0 This user is from outside of this forum
                        [email protected]
                        wrote on last edited by
                        #43

                        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.

                        1 Reply Last reply
                        2
                        • M [email protected]

                          Tailwind is for people that don't know how to use CSS properly. There, I said it.

                          K This user is from outside of this forum
                          K This user is from outside of this forum
                          [email protected]
                          wrote on last edited by [email protected]
                          #44

                          It shocks me to see how many programmers think such framework decisions are one-size-fits-all and jump to conclusion that such framework adoption decisions are is due to lack of skillset and experience.

                          There are many factors at play. You have time to build and maintain your own utility framework, please go ahead.

                          Two years ago, I led a team which developed a web app that generated 600 million impressions per year. We used Tailwind because we were a small team and I'd rather have my developers work on high value tasks and not maintain a style framework.

                          If you are an aspiring developer, know this: There are always trade-offs. Not writing pure CSS does not make you a bad developer. Not knowing system design does.

                          1 Reply Last reply
                          1
                          • blackmist@feddit.ukB [email protected]

                            Which CSS framework is it that puts this shit everywhere?

                            That one can die in a fire.

                            E This user is from outside of this forum
                            E This user is from outside of this forum
                            [email protected]
                            wrote on last edited by
                            #45

                            I'm honestly not sure, but I'm fairly certain it's intentional obfuscation done for the production build. Why they think it's so important to hide class names, I'll never know.

                            K 1 Reply Last reply
                            5
                            • blackmist@feddit.ukB [email protected]

                              Which CSS framework is it that puts this shit everywhere?

                              That one can die in a fire.

                              T This user is from outside of this forum
                              T This user is from outside of this forum
                              [email protected]
                              wrote on last edited by
                              #46

                              fun fact: This isn’t any one specific CSS framework's doing but rather part of how JS UI libraries handle scoped CSS. When you have for example two components that have similar CSS, like one component sets button to color green, another component sets button to blue, then the compiler does this kinda thing because "real" CSS doesn’t support scoping.

                              So in the above example you'd get button class abcd and button class bcde.

                              F 1 Reply Last reply
                              12
                              • E [email protected]

                                I'm honestly not sure, but I'm fairly certain it's intentional obfuscation done for the production build. Why they think it's so important to hide class names, I'll never know.

                                K This user is from outside of this forum
                                K This user is from outside of this forum
                                [email protected]
                                wrote on last edited by
                                #47

                                To fight ad blockers

                                1 Reply Last reply
                                4
                                • F [email protected]

                                  How are class names relevant for accessibility?

                                  M This user is from outside of this forum
                                  M This user is from outside of this forum
                                  [email protected]
                                  wrote on last edited by [email protected]
                                  #48

                                  https://lemmy.zip/comment/19872383

                                  Usability by third-parties. A webpage is not a pdf.

                                  F 1 Reply Last reply
                                  0
                                  • T [email protected]

                                    fun fact: This isn’t any one specific CSS framework's doing but rather part of how JS UI libraries handle scoped CSS. When you have for example two components that have similar CSS, like one component sets button to color green, another component sets button to blue, then the compiler does this kinda thing because "real" CSS doesn’t support scoping.

                                    So in the above example you'd get button class abcd and button class bcde.

                                    F This user is from outside of this forum
                                    F This user is from outside of this forum
                                    [email protected]
                                    wrote on last edited by [email protected]
                                    #49

                                    How *some JS UI libraries handle scoped CSS. Vue for example uses data- attributes instead.

                                    1 Reply Last reply
                                    2
                                    • trickdacy@lemmy.worldT [email protected]

                                      I cannot tell if you're saying tailwind is taking away from useful abstractions or adding to them. I think it's taking away from them. A whole bunch of class names in the page is opposite to what we were taught and there was a good reason for the lesson: content and presentation should be defined separately. This lends flexibility, readability and accessibility. Tailwind doesn't help with anything but preventing a breakage in another component/page. To me the reason to value this trade off is that you don't want devs to "have to care about css" which is a bad sign to begin with. It says "we think the way the web is built is bullshit, so let's just try to work around that with the latest attempt to make it better". The web is not bullshit. CSS is beautiful. Embrace the challenge. (Sorry I'm only halfway directing this rant at you)

                                      pupbiru@aussie.zoneP This user is from outside of this forum
                                      pupbiru@aussie.zoneP This user is from outside of this forum
                                      [email protected]
                                      wrote on last edited by
                                      #50

                                      imo there’s VERY little difference to a lot of tailwind and style=“…”. you gain a few minor abstractions, but you lose so much

                                      trickdacy@lemmy.worldT 1 Reply Last reply
                                      1
                                      • M [email protected]

                                        https://lemmy.zip/comment/19872383

                                        Usability by third-parties. A webpage is not a pdf.

                                        F This user is from outside of this forum
                                        F This user is from outside of this forum
                                        [email protected]
                                        wrote on last edited by
                                        #51

                                        That's not accessibility.

                                        M 1 Reply Last reply
                                        0
                                        • L [email protected]

                                          That's a common misconception by people who never used it. The truth is you need to know CSS to use Tailwind. Just because it simplifies styling doesn't mean it simplifies the underlying technology.

                                          pupbiru@aussie.zoneP This user is from outside of this forum
                                          pupbiru@aussie.zoneP This user is from outside of this forum
                                          [email protected]
                                          wrote on last edited by
                                          #52

                                          you need to know css to use tailwind because it’s basically style= on everything: it’s css with extra steps

                                          L 1 Reply Last reply
                                          2
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups