An overview of what makes modern CSS so awesome.

  • bleistift2@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    1 year ago

    I wish there was a comprehensive resource for CSS. I’ve known for a very long time that I don’t know the half of it. But randomly clicking through the MDN topics has a very [Edit: low high] cost to benefit ratio. Where do you learn about the gems of CSS without getting bogged down by the obscure topics like text-emphasis-style?

  • Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    10
    ·
    1 year ago
    :root {
      color-scheme: light dark;
      --text: light-dark(#000, #FFF);
      --bg: light-dark(#EEE, #242936);
    }
    

    Hmm, I guess the advantage of that over

    @media (prefers-color-scheme: dark) {
        /*set different values for variables*/
    }
    

    is that you can set the color scheme via a button much more easily then.

    Had to think about that for a moment, because the old way of doing things seemed fine, but that is a pretty good reason, I guess.

  • hperrin@lemmy.ca
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 year ago

    That’s great and wonderful, except some of those things don’t work on an iPhone. As long as Apple is holding back the industry, we’ll have to use JS for some things.

    • BrikoX@lemmy.zipOP
      link
      fedilink
      English
      arrow-up
      14
      ·
      1 year ago

      Or just say fuck them and refer them to Apple customer service when they start complaining since it’s an Apple issue not platform issue.

      • bleistift2@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        24
        ·
        1 year ago

        Do you work as a web dev? Flipping off 20% of your user base doesn’t exactly land you jobs.

        • Lucy :3@feddit.org
          link
          fedilink
          arrow-up
          7
          ·
          1 year ago

          I’d guess a large portion here are hobbyists, and I’m totally fine with showing 20% of random people the consequences of their choices, as it has no actual impact on anyone, and a lot of professionals have to adhere to company standards, so going JS-less isn’t even an option anyway.

          • Victor@lemmy.world
            link
            fedilink
            arrow-up
            3
            ·
            1 year ago

            random people the consequences of their choices

            These random people aren’t aware of the consequences of their choices and shouldn’t be punished for them. But at the same time, Apple needs to feel some pressure. But I doubt that regular users are going to go to Apple’s customer service and complain about sites that aren’t working on their phones. People just don’t do that. It’s a tricky conundrum.