Re: Composite pseudo classes

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 UTC