'New' CSS Selectors, and CSS4 Selectors

I’ve noticed that the official CSS reference page is missing links to some CSS selector pages, like cursor and user-select. I assume this is because their specification is still in draft form (although not in the case of cursor). If the CSS reference page shouldn’t link to these less stable (but still useful) selectors, I suggest there be a reference page for newer but mostly stable selectors. This page could be linked to in the primary CSS reference page.

I personally find the CSS reference page extremely helpful when looking up a selector. However, with some useful selectors missing, I feel some selectors may be harder to find than they could be.

@Joshua_Gerrity Hi there.

The cursor property is on there, but user-select is not. AFAIUI, the list of keywords on this pages is generated automatically from the other pages in the reference. We have a user-select page, and it is tagged correctly, but it is not appearing here. And I’m not sure why.

Interesting. I didn’t realize it was automatically generated. Hopefully this can be fixed sometime soon. I find user-select very useful, but not fully intuitive for memorization, hence it’s inclusion on the reference page.

I dug into this a bit, and here’s what I found:

  • The CSS reference page list is generated by the CSS_Ref macro (not to be confused with CSSRef).
  • That macro reads from /mdn/data/css/properties.json (among other files), which lists data about CSS properties.
  • The CSS_Ref macro discards properties that are not defined with "status": "standard". E.g., nonstandard and experimental values.
  • user-select is listed in properties.json as "status": "nonstandard".
  • This appears to be false, as (a) there is a spec for it listed in the article, and (b) the browser compat data for user-select defines it as "standard_track": true.

I submitted an issue in the mdn/data repo about this.