It feels like it is missing ways to help you get to understand things on your own, so a bit more like a test than a real game. Maybe a codegolf scoring (number of characters) and/or semantic scoring (number of atomic expressions used) would help?
As somebody who's doing frontend excessively rarely, it would feel more rewarding to see it compared to some good practices answers. Maybe store the results so you could display the most frequent answers in a future iteration?
Took 16 minutes, trying to understand more than to speedrun.
Btw, link of hint 10 is broken (there's an extraneous comma).
The dynamic selection dots are quite neatly done.
I found it quite fun and it seems like there are many ways to add interesting features!
I agree on the test thing. Would've been helpful for the creator (if they actually wanted to create something that would teach people who are new to it) to review educational techniques employed by people such as Michel Thomas (https://www.youtube.com/watch?v=W0fDO4IuO-M&ab_channel=Audio...), programmed instruction (behavior analysis), and transfer of learning.
i have to disagree strongly on this.
on each challenge you get a hint on the bottom which links you to the documentation of the selector you've gotta use
it was the first time for me using elem ~ elem and elem + elem selectors for example
The use of `:not` is way more powerful that I usually remember. For example, the second exercise asks to select all the <p> except the one with class="foo"
However, note that doc page on MDN [1] warns you it may not work in all browers.
> Using two selectors at the same time is not yet supported in all browsers. Example: :not(.foo, .bar). For wider support you could use, :not(.foo):not(.bar)
Minor quibble: level 6’s code uses </input>, which is invalid in HTML syntax (though harmless): <input> is a void element, meaning it can’t have any children and has no end tag.
(You could write <input/>, the old XML syntax for self-closing tags, but I strongly recommend against doing that because it teaches a wrong mental model: that trailing slash is permitted in HTML syntax on void elements for XHTML compatibility but does not close an element: it’s just ignored.)
> I strongly recommend against doing that because it teaches a wrong mental model
What's wrong with using XML as the underlying mental-model for HTML5 (HTML "Living Standard", etc)? HTML still supports XHTML and (to my knowledge) the only appreciable difference between HTML and XHTML is the requirement that the HTML tag soup be a well-formed XML document. That's it. XHTML is still valid HTML, and XML's model is simple and easy to understand and covers 100% of HTML's use-cases.
The difference between XHTML today vs. back in 2005 was that the W3C grossly underestimated the extent at which modern tooling will continue to generate invalid HTML markup (let alone any truly semantic HTML markup either), so web-browsers and scrapers needed to be more forgiving in their input processing and also standardise how they interpreted invalid HTML. None of that precludes us from writing software to a higher standard: software which generates valid XHTML which allows HTML to be handled by existing XML-processing infrastructure (and even serialized to JSON if you're crazy). What's "wrong" about any of that?
It teaches the wrong mental model for the HTML syntax. If you’re using the XML syntax, by all means use self-closing tags, but very few things do that, and almost all of them are over a decade old. (I set up gitweb last week, and it uses XML syntax HTML, and needs it because it nests links, which is invalid but works in XML syntax, and impossible in HTML syntax. It also does other wrong things like omitting the <tbody> in tables, which is inserted automatically in HTML syntax.)
What I observe is that it’s quite common for people to put in the trailing slash on void elements, but that it’s almost never (<1%) applied consistently (you’ll see some <link/> and some <link>) so that any XML syntax compatibility argument is void, and I’ve come across at least one person who thought it was necessary and at least one person who thought it closed tags (and thus could be applied to non-void elements) and was surprised that it didn’t.
XHTML is dead. XML syntax for HTML is on indefinite life support (with no prospect of being either revived or removed). HTML is not XML: the HTML and XML syntaxes are mutually incompatible (e.g. <noscript> isn’t possible in XML syntax, and <script>"&"</script> produces a different result). Writing your HTML in more XMLy ways isn’t about higher standards, but about making it something that it’s not. It’s wrong to use XML processing infrastructure on HTML documents unless they’re marked as XML syntax, because even if it doesn’t fail, it may interpret things incorrectly.
I feel like there should be another scoring axis rather than just time. I think selector length would be wrong, but something like selector complexity, or how robust the selector is to updates.
I scored 3m 50s, but felt like some of my selectors were a bit 'dirty'.
The timer encourages quick and dirty solutions. It took me a while to think of :is(input, button):not([disabled]) instead of a longer solution that I used at first. Another example was span[data-item] which is enough to mark exactly the required items at that level but I had found a longer, more specific selector for that first.
> It took me a while to think of :is(input, button):not([disabled]) instead of a longer solution that I used at first.
The intended solution is just :enabled. This is where I think this project has failed badly in its stated goal to “improve your CSS knowledge”, because all it offers in that direction is a little hint link; to actually teach, it needs a set of proposed solutions, and at the end show you any where you differed.
Such a thing might also help suggesting just [data-item] instead of the needlessly-more-specific span[data-item]. And also whether :nth-child(2n+3) was the intended solution on one of them.
Same here, and to be honest I'm still not sure what the clean solution would be for this level. With that particular html structure and class/id usage there maybe isn't any…
4:22 - I got stuck on the ID one because I felt like I was meant to do something than select each one individually. I also got stuck on :enabled and ended up writing something dumb in retrospect. Some of my selectors were quite hacky in the name of speed though.
It would have been nice to see what the intended solutions after because otherwise I have no way of finding out that using :enabled was the intended way and not input:not(disabled), button:not(disabled). Realized after I could have used an :is there but I don't use :is often in work due to browser support for IE so it didn't cross my mind at the time. It would also be nice to see that #one, #three, #five, #nine (or whatever the ID's where for that puzzle) was indeed the "intended" answer as a kind of trick question.
Without reading HN I would not have learned I was meant to use :enabled.
7:22, but I needed a lot of hints. And many of my selectors were rather arbitrary lists of unconnected selectors. I feel like there should be better answers than the ones I gave.
5:25, not terrible. Couple of them I was able to brute-force, some of them I realised the easy solution as I was brute-forcing! It's fun, :not(...) is godsend.
Oooh that's so nice! Thanks!
I was trying to select stuff using span[data-item*="foobar"]
Or something of the sort...but it wasn't working, so I just ended up writing a is() selector ^^
More fun than I expected, though I seem to have forgotten how IDs are a thing you can target, everything is classes these days, so only got a time of 10:28 due to spending minutes writing an insane selector rather than ID, ID
I would extend its usefulness by rewarding shorter answers, as you could cheat a lot by using long nth-child selectors for everything which is basically unusable in actual stylesheets
I know most rules that exist but don't always remember them off the top of my head so I look them up. That being said, I was not actually aware of :not
It feels like it is missing ways to help you get to understand things on your own, so a bit more like a test than a real game. Maybe a codegolf scoring (number of characters) and/or semantic scoring (number of atomic expressions used) would help?
As somebody who's doing frontend excessively rarely, it would feel more rewarding to see it compared to some good practices answers. Maybe store the results so you could display the most frequent answers in a future iteration?
Took 16 minutes, trying to understand more than to speedrun. Btw, link of hint 10 is broken (there's an extraneous comma).
The dynamic selection dots are quite neatly done. I found it quite fun and it seems like there are many ways to add interesting features!