Re: [CSS21] What does 'text-transform: capitalize' mean, exactly?

On Tue, Oct 21, 2008 at 8:20 AM, Henrik Hansen <henrikb4@gmail.com> wrote:

>
> Les Brown wrote:
>
>> My dictionaries say that capitalize means "put ALL the text in capitals"
>> but I guess it's too late to change the spec.
>
>
> A capitalized text is where the first letter in every word is uppercase,
> like this:
> The Quick Brown Fox Jumbed Over The Lazy Dog.
>

No, Les definitely has a point.  I too refer to upcasing the first letter of
every word as "initial-caps", and my fingers always try to type that out
when I mean capitalize in a text-transform rule.  It's really not that
important, though.


>
> Also, if a future version of the spec introduces a "capitalize-all" text
>> transformation, what should happen to camel-case text like "WebKit"?
>
>
> Now this raises an even bigger question.
>
> <span style="text-transform:lowercase">
>    TeX is a typesetting program made by Donald Knuth.
>    <span style="text-transform:capitalize">
>        Few people write in raw TeX, most do it in LaTeX
>    </span>
> </span>
>
> What will this render as?
> tex is a typesetting program made by donald knuth. Few People Write In Raw
> Te?, Most Do It In La?e?
>
> What is the right way?
>

Um, uppercase and lowercase are *already* valid text-transform values.  You
can just test these things yourself.  In the first case (camelCased word
being affected by uppercase) the word goes uppercase, so you get WEBKIT
rather than WebKit.  In the second, the first sentence is entirely
lowercased, while the first letters of each word in the second sentence are
capitalized, and additional capitals later in the word are left as-is
(because only one text-transform value can be in effect at a time, and
capitalize doesn't have any effect on the rest of the words).

~TJ

Received on Tuesday, 21 October 2008 13:41:35 UTC