• TCB13@lemmy.world
    link
    fedilink
    arrow-up
    23
    ·
    1 day ago

    Yeah CSS is now decent. The only problem is that the nesting is not very well supported yet. It’s something like only browsers > 2023 and let’s be realistic people run old machines.

    • Kissaki@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 hours ago

      I’ve read interesting argumentation against nesting. I’m not confident in whether it’s more useful or not, in some situations or in general.

    • pcouy@lemmy.pierre-couy.frOP
      link
      fedilink
      arrow-up
      2
      ·
      15 hours ago

      We still see somewhat old browsers, especially from people using Safari on Apple devices (because IIRC it only updates when you update the whole OS). But it’s a lot better than it used to be thanks to most browser having auto-updates

    • pinchy@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      1 day ago

      Definitely not widely supported enough. Made the switch from sass back to css quite a while ago and let postcss polyfill less supported features like nesting.

      • TCB13@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        23 hours ago

        Yeah, I was reading about PostCSS the other day, but still too lazy to change my environment. To be fair I only need the nesting polyfill and some kind of minifier, the rest I can live with native stuff.

  • unmagical@lemmy.ml
    link
    fedilink
    arrow-up
    20
    arrow-down
    1
    ·
    1 day ago

    I, uh, hate that radius calculation. Why does the radius need to be reactive? What do you stand to gain over just setting to like 3 or 4px and moving on with your life?

    • pcouy@lemmy.pierre-couy.frOP
      link
      fedilink
      arrow-up
      3
      ·
      16 hours ago

      I’m not sure how this relates to the shared post. I’m just searched the article for “radius” and only found one example where a variable is defined then used later. Were you talking about this ? Or can you clarify what “radius calculation” you hate ?

      • lucas@startrek.website
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        11 hours ago

        They’re referring (I believe) to the screenshot right at the top of the article, which includes this absurd calculation:

        border-radius: max (0px, min(8px, calc( (100vw - 4px - 100%) * 9999)) );
        

        My guess (hope!) is that this is not ‘serious’ code, but padding for the sake of a screenshot to demonstrate that it’s possible to use each of these different features (not that you should!).

        • pinchy@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          5 hours ago

          It‘s used in Facebooks css. Remembered it from a nice article from Ahmad Shadeed. And while this limbo sure has some usefulness, it‘s way too obscure to use it for the fun of it.

          To add to this: CSS really has come a long way. This border-radius example can be done with Container Queries by now, which has quite good support already.

        • pcouy@lemmy.pierre-couy.frOP
          link
          fedilink
          arrow-up
          2
          ·
          11 hours ago

          border-radius: max(0px, min(8px, calc( (100vw - 4px - 100%) * 9999)) );

          Oh I missed this. I think it’s only here to showcase doing math between different units, which is really nice in my opinion. I’m thinking about a few instances where I had to resort to dirty JS hacks just because CSS did not support this at the time

        • tapdattl@lemmy.world
          link
          fedilink
          arrow-up
          16
          ·
          1 day ago

          He did

          […] Why does the radius need to be reactive? What do you stand to gain over just setting to like 3 or 4px and moving on with your life?

          Junior webdev points

          AKA you gain nothing.

          • unmagical@lemmy.ml
            link
            fedilink
            arrow-up
            20
            ·
            1 day ago

            Oof, I might have wooshed there. Totally read that comment as criticizing my inquiry as things a Jr would ask and not as the implementation being “look what I as a Jr can do!”

  • Paradox@lemdro.id
    link
    fedilink
    English
    arrow-up
    6
    ·
    23 hours ago

    I still reach for sass for a lot of things, but now you don’t have to, which is really nice

      • frezik@midwest.social
        link
        fedilink
        arrow-up
        18
        ·
        1 day ago

        I could understand declaring with --foo, but then referencing should be either var(foo) or just --foo, not the combination var(--foo). I don’t get why the grammar has to work that way.