• Rose
      link
      fedilink
      169 days ago

      If using plain CSS, usually it’s enough to set width appropriately, and margin-left and margin-right to auto.

      If using a Modern Frontend/CSS Framework, then may God have mercy on your poor soul.

      (Seriously I just started a new project with TailwindCSS and I’m so confused. But not entirely desperate yet.)

      • The Ramen Dutchman
        link
        fedilink
        English
        12 days ago

        My brother in Christ TailwindCSS just gives classes that let you do inline styling in a shorter syntax! (and theme configuration, but mostly inline styling)

        Replace width: ...px with w-..., margin-left: ... with ml-... and margin-right: ... with mr-.... Setting both horizontal margins is mx-... and both vertical margins is my-....

        If you can do inline styling, TW just makes the syntax a bit shorter, but that’s it, really.

        • @[email protected]
          link
          fedilink
          English
          169 days ago

          If you spend a lot of time on a single framework, you will transcend and become a sort of frontend diety, growing multiple extra limbs allowing you to type in CSS classes faster than any mere mortal

            • @[email protected]
              link
              fedilink
              2
              edit-2
              8 days ago

              What’s sad is that web development is only a nightmare so websites can be worse.

              I genuinely believe it’s part of the concerted effort by the cabal to make us accept a ‘new normal.’

              They don’t want an environment where anyone feels like they can make a website. They want us to believe we need to spend years studying before we can do anything, and even then we can only do what our bosses tell us to.

              • @[email protected]
                link
                fedilink
                English
                17 days ago

                This is a bit of a stretch I think…

                Web development is complicated because it’s indredibly poorly “designed” from the beginning, and doing a full redo is impossible.

                It is 100x easier today than it was in 2006 when I started.

        • @[email protected]
          link
          fedilink
          18 days ago

          I think they exist because of ignorance.

          People who don’t understand how to do a task will usually choose the wrong tools for that task.

          If someone is trying to cover up their lack of knowledge, they will usually make things more complicated than they need to be.

        • @[email protected]
          link
          fedilink
          59 days ago

          Generally I find many these frameworks will make some complicated things simple, but the cost is some things that were once simple are now complicated. They can be great if you just need the things they simplify - or in other words can stick to what they were intended for, but my favorite way of keeping things simple is to avoid using complicated and heavy frameworks.

      • @[email protected]
        link
        fedilink
        English
        29 days ago

        I’m doing a small hobby project (a ladder/ranking system for playing beer sports with my community), and I tried out Tailwind.

        I gave up and loaded Bootstrap instead, but I will probably end up just writing all the CSS myself.

        Seems so silly to have 15 CSS classes on a single DOM element…

        • @[email protected]
          link
          fedilink
          18 days ago

          Why is that silly? As long as the classes follow a strict naming scheme & have useful abstractions, that seems much better than having to give every node a unique class name that doesn’t necessarily have much meaning. I can’t count the number of “container” and “wrapper” and “content” classes I’ve seen & written, where the names don’t describe anything useful.

          • @[email protected]
            link
            fedilink
            1
            edit-2
            8 days ago

            Shouldn’t they be designed in an intuitive manner that makes misuse more difficult than regular use?

            Otherwise, why even bother using them? It’s like now you need to know all the ins and outs of CSS and a trendy framework that will lock you into their ecosystem.

            • @[email protected]
              link
              fedilink
              English
              28 days ago

              Kidding aside, I think the popular frameworks these days are incredibly well made. Frontend web has always been hell, and if your job is producing functional web GUIs, you can’t do it on a large scale without them.

              • @[email protected]
                link
                fedilink
                18 days ago

                Based on my own experience developing GUIs, I’ve reached the conclusion that creating them through code is obsolete.

                We should be focusing on developing GUIs to develop GUIs, like Godot, instead of ‘frameworks’ that make an obsolete method of doing things even more cumbersome and complex.

            • @[email protected]
              link
              fedilink
              English
              18 days ago

              Well, I find bootstrap very intuitive, and I don’t have 15 classes on my elements. That’s why I was asking.

    • @[email protected]
      link
      fedilink
      English
      109 days ago

      Depends if you’re centering the div or the things in the div. Which has probably been the main issue since CSS was invented.

    • @[email protected]
      link
      fedilink
      10
      edit-2
      9 days ago

      If you define what you mean by centering I’ll give you a straight answer.

      Vertically? Horizontally? Center the text or the entire box? Compared to the viewport, the parent container or the entire page?

      “Centering” isn’t as straight forward as you’d think, and what you actually want usually depends on the situation.

      • Schadrach
        link
        fedilink
        English
        49 days ago

        Fuck it, align=‘center’. That’ll center it horizontally relative to some context and if that’s not good enough then you should have been more precise in your request.

        • @[email protected]
          link
          fedilink
          49 days ago

          Yeah that works if you wanna center a box of content it relative to the parent container, either horizontally or vertically. For other situations we’ve got different tools

    • @[email protected]
      link
      fedilink
      English
      79 days ago

      Same way you did it in 2024 but it’s easier because the springgirdles have been replaced with rotated manglebrackets.