My name is Jake Marsh.
I'm a developer, designer, and writer.

Subscribed via Push Notifications. You can also subscribe via RSS or Twitter.

Subscribe via RSS or Twitter.

Subscribe via Push Notifications, RSS or Twitter.

▸ CSS4 Selectors

Looks like the CSS Working Group has published their first working draft of how they'd like CSS4 selectors to work.

Here are some of the highlights:

    var el = document.querySelector("#foo"); // returns first element with ID of foo
    var bar = document.querySelector(":scope > p", el); // returns equivalent of "#foo > p"
li a:matches(:link, :hover, :visited)
a:local-link /* Matches anything that links to the current page */
a:local-link(0) /* Matches any link that is the same domain */

There's tons more and David Storey does a great job of explaining stuff in his blog post.

Vote on Hacker News