W3C home > Mailing lists > Public > www-style@w3.org > October 2000

Re: New version of the Selectors module of CSS3

From: Jonas Sicking <sicking@bigfoot.com>
Date: Fri, 6 Oct 2000 02:44:27 +0200
Message-ID: <017701c02f2e$94f10b40$3110f7d4@ericsson.se>
To: "Daniel Glazman" <glazou_2000@yahoo.fr>, <www-style@w3.org>
Daniel Glazman wrote:

> I am glad to announce the availability of a new version of the
> CSS 3 Selectors module. Changes from previous versions are listed
> in the document itself.

> Of course, all your comments and suggestions are highly welcome,
> in this mailing-list.
>
> http://www.w3.org/TR/css3-selectors/

Great draft! However I miss some things discussed/proposed in this list.
Don't know if you've missed them so here goes : )

1. :default pseudo-class.
represents the element that will be activated when the user presses default
activate key (normally enter). This is useful for showing what action will
be taken if the user presses (for example) enter and is used in most windows
applications. This is a dynamic property and depends on what element
currently has focus. For example:
<style>
 :default { outline: thick solid black; }
</style>
<form action="cgi1"><input name=a><input type=submit value="text
search"></form>
<form action="cgi2"><input name=b><input type=submit value="file
search"></form>

if the "a" input has focus the "text search" would have a black outline. If
however the "b" input was given focus the outline would be applied to the
"file search" button. It would be up to the useragent (or the markup) to
decide which element should be activated, but whichever it is the :default
pseudo-class rules would be applied to it.

2. pseudo-class inversion.
It is sometimes useful to apply inverted pseudoclasses such as is suggested
on some of the structural pseudo-classes (:not-first-of-type,
:not-nth-of-type(n) etc). For example if I think that the default blue links
go very badly with my design but I still want to let users decide how they
want their links to look like I could do something like:

a:not-hover { color: inherit }

That way users will clearly recognize their default link look once they
hover over the link, whatever color they have selected for links per
default.
So I propose that the "not-" prefix is removed from where it currently
exists and is made generic instead so that it could be applied to any
pseudoclass

3. nth-last-child(n)
As much as there is need to select the second, third, or seventeenth element
there is need to select the second last, third last and seventeenth last
child/element of type.

4. nth-child(3 to 10)
ability to select a range of children would make the stylesheet more
readable then doing
:nth-child(3), :nth-child(4), :nth-child(5)... { color: gray }

5. entities
If I have a XML file containing unresolved entities it could be really
useful to be able to style those. If I for example have an XML file system
users I could do.

Email > &null; { color: red; content: 'missing'; font-weight: bold}

6. every other child (this one is new : )
It's very common to style long lists so that every other line has a
different color in a long and wide table listing to make it easier to read.
I would suggest some sort of pseudo-class which would allow me to select
every n'th element such as

tbody > tr:every-nth-child(3,1)

would match the 1:st, 4:th, 7:th etc row. And
tbody > tr:every-nth-child(5,5)

would match the 5:th, 10:th, 15:th etc row. This could ofcource be done as
:every-nth-of-type(n,m) as well

/ Jonas Sicking
Received on Thursday, 5 October 2000 20:43:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:06 GMT