I am not allowed to credit the site that has this disaster. Its owner said “Nobody should see that”

  • TechieDamien@lemmy.ml
    link
    fedilink
    arrow-up
    74
    ·
    4 months ago

    Client: “Can you switch these two colours, you have 1 minute to fix it or you’re fired!”

    Result:

      • Pasta Dental@sh.itjust.works
        link
        fedilink
        arrow-up
        17
        arrow-down
        1
        ·
        4 months ago

        At least that’s actually easy and quick to do and is the only way of doing it. Centering a div however has 81639393 ways and it seems the one that works is different every time

      • kamen@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        4 months ago

        It’s a good indicator that someone is desperate and/or doesn’t know what they’re doing.

  • 9point6@lemmy.world
    link
    fedilink
    arrow-up
    28
    arrow-down
    3
    ·
    4 months ago

    Not allowed to credit the site in your text editor?

    Is the owner in the room with you now?

  • drathvedro@lemm.ee
    link
    fedilink
    arrow-up
    14
    ·
    4 months ago

    I’m appalled that classes representing visual styles are still a thing. I thought everyone already figured that it was a bad idea back in bootstrap days. But then I recently had an opportunity to work on project that uses Vuetify and saw quite long poems about flexboxes in class names…

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      4 months ago

      Well, there’s not exactly a class training you have to take before writing CSS, so everyone starting out with it gets to make all those same mistakes for themselves before they know how to use classes sensibly. I myself am some backend guy, who has to write CSS far too often.

      It certainly also does not help that various CSS frameworks out there do exactly that…

      • bleistift2@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        3
        ·
        4 months ago

        It certainly also does not help that various CSS frameworks out there do exactly that…

        Bootstrap (as of v5) being one of them. div class="d-flex gap-2 my-3 align-items-center flex-nowrap justify-content-between

        I was annoyed at this at first, but I’ve since noticed that I write hardly any CSS any more, because most rules really are “just add some space, vertically align, be red”.

        • Blackmist@feddit.uk
          link
          fedilink
          English
          arrow-up
          5
          ·
          4 months ago

          Could argue here that you’re still writing CSS, just cross compiling to it from Bootstrap shortcuts.

        • Ephera@lemmy.ml
          link
          fedilink
          arrow-up
          6
          arrow-down
          1
          ·
          edit-2
          4 months ago

          Yeah, the reason why people deride it, is because it’s practically equivalent to:

          div style="flex: 1; gap: 2em; margin-top: 3em; margin-bottom: 3em; ..."
          

          I had to look up what these do, so they might not be precisely correct translations, but hopefully, you get the idea. It’s mostly like using inline styles, and like not using classes.

          In some scenarios, these frameworks might simplify certain things, like how my applies two CSS rules. And they reduce the visual clutter of inline styling somewhat.

          But overall, it feels like people are dissatisfied with semantic classes, but don’t want to lead the discussion for using inline styles, so they grab these CSS frameworks to pretend that they’re not using inline styles.

          It is fundamentally a difficult discussion to lead, because inline styles feel great, while you’re writing them. They’re less great for maintenance.
          But semantic classes definitely have long-term problems, too.

    • wizzor@sopuli.xyz
      link
      fedilink
      arrow-up
      11
      ·
      4 months ago

      I don’t get it, isn’t this a pretty normal way of using media queries. Granted you’re more likely to see the widths defined in px.

      • ByteOnBikes@slrpnk.net
        link
        fedilink
        arrow-up
        8
        arrow-down
        1
        ·
        4 months ago

        Shhh… The poster doesn’t understand CSS and we shouldn’t embarrass them in a community with memes

        • wizzor@sopuli.xyz
          link
          fedilink
          English
          arrow-up
          3
          ·
          4 months ago

          My imposter syndrome kicked in full swing. I was ready to learn a CSS best practice and feel uncomfortable about it for the rest off the day.

        • usernamefactory@lemmy.ca
          link
          fedilink
          arrow-up
          2
          ·
          4 months ago

          This is technically responsive, but I think you have a fair criticism. A single rule like this would be much more maintainable:

          #content .grid-container {
          	width: 90vw;
          	min-width: 12rem;
          	max-width: 75rem;
          	padding: 2rem 0 1rem;
          }
          

          Obviously, media rules have their place, but not for something that’s consistantly a full width container like this seems to be.

  • aeronmelon@lemmy.world
    link
    fedilink
    arrow-up
    12
    arrow-down
    1
    ·
    4 months ago

    “Some coders just want to watch the word burn get colored white and/or lime.”

    And if you delete one or the other, or condense the code into a single command, the whole site breaks.

  • dajoho@sh.itjust.works
    link
    fedilink
    arrow-up
    8
    ·
    4 months ago

    I am very, very surprised about the competence of the commenters here. I have had many discussions on reddit about the advantages of meaningful instead of presentational class-naming and you’re normally met with great resistance, especially with users of frameworks like Bootstrap and Tailwind.

    Here, everyone seems to either ‘get it’ or is willing to hear why classes like .lime are bad. Very cool.

  • bloubz@lemmygrad.ml
    link
    fedilink
    arrow-up
    6
    ·
    4 months ago

    I guess the class matches the color of the background (applied on a parent element), and the text is the opposite color?