1. 3
  1.  

  2. 2

    This saddens me. I’m a big hater of custom elements, of webapps that necessitate javascript to be turned on to function at all. (There is a point to requiring javascript, but I still want to have a minimal view without it. If javascript is turned off and your app can only show me a blank screen, it has failed; in my opinion.)

    However, this feature is incredibly useful. I’ve run into the exact same situation, and couldn’t come up with a satisfactory answer. You have! And it’s wonderful! But I’m hesitant to use it since it ties site presentation so deeply with javascript. That’s not necessarily a problem, even with my above stated opinion, as disabling CSS should still present a workable interface.

    I just wish browsers would have supported something like this natively already without requiring a secondary layout engine sitting on my website. C'est la vie.

    1. 1

      I just wish browsers would have supported something like this natively already without requiring a secondary layout engine sitting on my website. C'est la vie.

      This is the end goal of all this research! First there was a need, a solution is born out of that need. The solution matures and grows by responding to real-world problems, and over time a more clear picture of the solutions begins to take shape. After clarity is attained you can write up that solution as a specification, a specification can be submitted and considered for inclusion in the language, and if approved, eventually browsers will add support for approved language features.

      Though people have been working with the idea of Element Queries since ~2013, so far we were still in the early stages of that process. Now there’s work being done on an unofficial spec - hopefully this catches the interest of W3C and browser developers, and maybe someday this will enjoy browser support :D

      Here’s a link to the WIP spec: https://tomhodgins.github.io/element-queries-spec/element-queries.html