W3C home > Mailing lists > Public > www-style@w3.org > November 2011

Re: Composite pseudo classes

From: Brian Kardell <bkardell@gmail.com>
Date: Wed, 9 Nov 2011 07:46:05 -0500
Message-ID: <CADC=+jfEJNavkmU8zJ7V=OfYFF-tQVnwLGnyb-j+TT+E=3Nd9Q@mail.gmail.com>
To: Pete Boere <pete@the-echoplex.net>
Cc: www-style@w3.org
There has been some offline discussion on this, specifically aliases.  They
would have to be prefixed but the idea is very similar to what you describe
here.
On Nov 9, 2011 7:19 AM, "Pete Boere" <pete@the-echoplex.net> wrote:

> Usually when using the :hover pseudo class it is appropriate to also use
> the :focus pseudo class for accesibility reasons. [1]
>
> Is it possible to have composite pseudo classes for this purpose?
> I've implemented a kind of composite pseduo class in a PHP CSS
> preprocessor[2] like this:
>
> .nav a:hocus { ... }
> .nav a:pocus { ... }
>
> compiling to
>
> .nav a:hover, .nav a:focus { ... }
> .nav a:hover, .nav a:focus, .nav a:active { ... }
>
> internally a substitiution is being made using an :any (:matches) shim [3]
> :hocus => :matches(:hover,:focus)
>
>
> [1]
> http://www.456bereastreet.com/archive/201004/whenever_you_use_hover_also_use_focus/<http://www..456bereastreet.com/archive/201004/whenever_you_use_hover_also_use_focus/>
> [2] http://the-echoplex.net/csscrush
> [3]
> https://github.com/peteboere/css-crush/blob/master/plugins/hocus-pocus.php
>
> --
> Pete Boere
> Web Developer
>
>
Received on Wednesday, 9 November 2011 12:53:13 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:46 GMT