easy to get into trouble for sure.

  • onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    7 months ago

    flexbox made things so much easier, but still hard. There are just too many rules to keep in your head about display and position and how they affect other attributes. And the box model… wow. margin, border, padding, content, but he attribute is box-sizing and it has border-box and content-box, but not the others.

    IINM it was written by people who came from print media (just like HTML) and that stuck.

    CC BY-NC-SA 4.0

    • BassTurd@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      As someone that has gone through some of the available online tutorials like freecodecamp, and has no real world experience, especially in a team setting, I think I agree with you. I wouldn’t say it’s hard, but I do feel it’s unnecessarily complicated in some areas. Some naming conventions are unintuitive, the cascading inheritance can get confusing especially with multiple hands working on something, and from my experiences, there’s minimal if any effort put into best practices, so everyone does things a little different.

      • griD@feddit.de
        link
        fedilink
        English
        arrow-up
        0
        ·
        7 months ago

        Pff, just define your own cascade with @layers :)

        Best advice I can give: Don’t use CSS directly, use a pre-processor like SASS/SCSS. It really helps keeping things sane and somewhat organized.

    • NullPointer@programming.devOP
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      unless you inherit a large base written by someone who is bad at it where their approach seemed to be to write new bad rules in attempt to cover up previous bad rules and so on. we all know how supportive employers are at addressing technical debt. (site redesign cant come soon enough)

      • underisk@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        7 months ago

        Not sure about your particular situation but there’s also the possibility that the bad CSS was good CSS when it was written and over time that got superseded by advancements in both technology and practice.

        • AggressivelyPassive@feddit.de
          link
          fedilink
          arrow-up
          0
          ·
          7 months ago

          Or simply different styles and/or skill levels were mixed. I’m currently sifting through a code base that I know for a fact started out goodish, but through multiple team reorgs and lax standards/tight deadlines it devolved into a hot mess. A major contributor being that most of the devs were inexperienced in the framework and just did what they thought was right.