Re: ::first-word pseudo-element

On 12/14/2010 07:34 AM, Pierre Bertet wrote:
> Thank you all for your answers !
>
> Karl,
>
>> Which means you need the full dictionary of characters. I do not English
> hyphenation is really handled in browsers for the same reason (please,
> make me wrong here.).
>>
>> Note that ::first-letter somehow is also misleading for asian languages
> such as Japanese and Chinese. Maybe it should have been ::first-char, but
> I guess it is too late. "::first-letter" was introduced I guess to mimic
> this old tradition of lettrines (Initial [1]). "Le charme suranné de
> l'écriture du monde physique".
>>
>> [1]: http://en.wikipedia.org/wiki/Initial
>
> Thanks, it’s clearer now.
>
>> "::first-chars-before-space" could work, but what would be the use case,
>> which is the thing missing in this discussion, I think.
>
> I have to admit that I will not have a big usage of this feature, I
> was more interested in the technical issue.
> That being said, I consider the “::first-chars-before-space” (or
> rather “::first-chars-group”) as a first step. “::nth-chars-group()”
> and “::nth-letter()” would be a lot more useful, with the rules
> already used by “:nth-child()”.
>
> Obviously, a “::regex()” would be great too, but I guess it will cause
> a lot of performance issues (and probably already discussed).

If you are selecting an arbitrary number of characters, then your style
sheet is dependent on the content. You very rarely want to style the first
three characters specially: sometimes it's the first three, sometimes the
first five: it depends on the actual *content*. Change the first word of
the document, and your style sheet is now wrong.

When the boundary of the style is dependent on the content, and not on the
layout, then it is more appropriate to express the boundary in the markup,
which, unlike the style sheet, is designed to be tied so closely to the
content.

~fantasai

Received on Tuesday, 14 December 2010 20:57:12 UTC