The Bard's Lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Homosexual sapiens@lemmy.blahaj.zone to Programmer Humor@programming.devEnglish · 2 years ago

W3C pls give us :focus-visible-within

lemmy.blahaj.zone

message-square
15
link
fedilink
92

W3C pls give us :focus-visible-within

lemmy.blahaj.zone

Homosexual sapiens@lemmy.blahaj.zone to Programmer Humor@programming.devEnglish · 2 years ago
message-square
15
link
fedilink
  • Skullgrid@lemmy.world
    link
    fedilink
    arrow-up
    46
    arrow-down
    3
    ·
    2 years ago

    what the fuck am I even looking at? Css is to make styles not cure cancer

    • sacbuntchris@lemmy.world
      link
      fedilink
      English
      arrow-up
      19
      ·
      2 years ago

      Interestingly, focus states are used in accessibility. So while this code isn’t to cure cancer, it likely does improve the lives of those with different needs.

      • Homosexual sapiens@lemmy.blahaj.zoneOP
        link
        fedilink
        arrow-up
        8
        ·
        edit-2
        2 years ago

        bingo, i made this meme while doing accessibility improvements at work

      • Skullgrid@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        2 years ago

        it’s starting to make sense, what exactly does the meme want me to do about focus states so it can be read properly by screen reader software/used by keyboard navigation?

        • Homosexual sapiens@lemmy.blahaj.zoneOP
          link
          fedilink
          arrow-up
          14
          ·
          2 years ago

          CSS has a pseudo-class, :focus-visible, that matches when an element is focused using keyboard navigation. It also has :focus-within, which matches when the current focused element is the selected element or one of its descendents. However, this applies not only for keyboard navigation but also mouse and tap focus. A pseudo-class that combines the two, :focus-visible-within, would be useful, but does not currently exist. Here’s an article about it: https://larsmagnus.co/blog/focus-visible-within-the-missing-pseudo-class

          The code in the meme implements the logic of :focus-visible-within using the new :has() functional pseudo-class, and has a snippet of fallback behavior for slightly older browsers

          • Skullgrid@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            2 years ago

            thanks for the explaination!

    • aͮͫͨ͋ͤͣ͌̏lex͒̃ͪ̃ͨ͛́͂ͪ͗̏ͫͮ̂@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      2 years ago

      That’s wizards chess

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 720 users / day
  • 1.93K users / week
  • 4.96K users / month
  • 9.81K users / 6 months
  • 1 local subscriber
  • 30.7K subscribers
  • 1.58K Posts
  • 28.3K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.14
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org