W3C home > Mailing lists > Public > www-style@w3.org > November 2011

Re: A Call for ::nth-everything

From: Lea Verou <leaverou@gmail.com>
Date: Tue, 01 Nov 2011 11:41:35 +0200
Message-ID: <4EAFBECF.5020908@gmail.com>
To: Charles Pritchard <chuck@jumis.com>
CC: Lars Gunther <gunther@keryx.se>, "www-style@w3.org" <www-style@w3.org>
On 31/10/11 21:57, Charles Pritchard wrote:
> On 10/31/11 12:30 PM, Lars Gunther wrote:
>> Bringig this to your attention
>>
>> http://css-tricks.com/14771-a-call-for-nth-everything/
>
> I've used "nth-char" as a step in an HTML rendering engine 
> (canvas+js), not to select a single character but to update my current 
> style for rendering inline text. It was handy and easier than 
> specifying and calculating ranges.
>
> The nth-everything proposal does not include ranges.
> I'd like ::nth-letter(3, 10) -- an offset and a length.
>
> That'd save me a lot of unwanted <span> manipulation.
>
> -Charles
>
That could be done with a combination of ::nth-letter rules if we become 
able to chain certain pseudo-elements (which is highly requested in 
other threads, not sure how it's going):
Letter >= 3 is ::nth-letter(n+3)
Letter <= 10 is ::nth-letter(-n+10)
Combining them: ::nth-letter(n+3)::nth-letter(-n+10)

However, I have a hunch that these suggestions, even though undeniably 
useful, will probably prove out to be very hard to implement in a 
reasonably performant way :(

-- 
Lea Verou (http://leaverou.me | @LeaVerou)
Received on Tuesday, 1 November 2011 12:40:21 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:46 GMT