[User Context] alternate taxonomy keys (GPII, Schema.org, etc.) could be implemented as custom media features

Media Queries Level 4 includes a "Custom Media Queries" section.
http://dev.w3.org/csswg/mediaqueries-4/#custom-mq

It seems extensible enough to use for the alternate taxonomy key use case we've discussed for IndieUI User Context. In other words, it'd be inappropriate to include all of the GPII or Schema.org keys directly as CSS media features, but these groups could choose to implement their taxonomies as prefixed custom media features. I spoke with Tab Atkins (one of the CSS editors, copied here) about this idea briefly at TPAC.

For example, GPII could define a set of de facto "--gpii-"-prefixed keys, and even provide an GUI editor to generate the CSS rules.

The end user could add these generated custom media rules to their user style sheet:

  @custom-media --gpii-prefers-transcript (color) or (monochrome); /* use any always-true media feature */ 

And web authors could then detect those user preferences via CSS using the defined media features for each taxonomy.

  @media (--gpii-prefers-transcript) {
    .transcript { display: block; }
  }

Or check the value in JavaScript via matchMedia.

  if (window.matchMedia("--gpii-prefers-transcript").matches) {
    myMedia.showTranscript();
  }

I think this means that, once CSS.customMedia is implemented, alternate taxonomies like GPII and Schema.org can operate on their own to define the list of prefixed keys. If some of those keys end up being useful in mainstream user contexts, those groups could document and propose them individually as mainstream media features, as we did with a few in CSS4.

Received on Thursday, 30 October 2014 21:37:33 UTC