Re: Suggestion for new link pseudo-class :current (or similar)

On 7/30/2007 11:26 AM Jonathan Snook cranked up the brainbox and said:
> It's an interesting idea. Would you see it differentiate between
> anchored links? if you're at example.html#anchor1 and the page has #,
> #anchor1 and #anchor2, do they all react to :current?

Good question. That's another point for discussion. Should it be exact,
matching URI and internal anchors, or not? In my opinion, it should be a
straight match.

Path: http://domain.tld/path/filename.ext
Link: http://domain.tld/path/filename.ext should be styled with a:current
Link: http://domain.tld/path/filename.ext#anchor should not

Path: http://domain.tld/path/filename.ext#anchor
Link: http://domain.tld/path/filename.ext#anchor should be styled with a:current
Link: http://domain.tld/path/filename.ext should not

However, if one is to go down this road, one may as well pave it. If :current
gains traction, how about:
:current-exact for what I describe above
:current-partial to match path and file
:current-path for only the domain.tld/path/ part
:current-

On 7/30/2007 4:35 PM David Woolley cranked up the brainbox and said:
> The big problem is that, in general, pages may have multiple URLs, and 
> with content negotiation, it may be the case that none of them match the 
> Location header that comes back with the HTTP response.

Certainly this solution does not solve all possible cases, and it never will.
But with the majority of pages being quite predictable and small, I'd much
rather have a solution that half the people can use than no solution than none
at all.

A feature does not need to be useful to everyone, merely to enough people to
warrant the work. Since this has been requested a number of times here shows
that enough people with a cup of brain matter to find the list have bothered
to speak up, and also shows that since only a fraction of the populace bothers
to speak up, there has to be a large number of people who would use this. I'd
even wager more people would use this than a goodly number of other CSS
features already in the spec.

Another objection I had on my blog was:
"Nice idea, but you'd run into difficulties identifying the "current" page on
any but the simplest sites."

Most sites /are/ simple sites. See my argument above.

-- 
Grey Hodge
 email [ grey @ thecloudygroup.com ]
 web   [ http://www.thecloudygroup.com ]
 motto [ Make everything as simple as possible, but no simpler. - Einstein ]

Received on Tuesday, 31 July 2007 03:59:29 UTC