Re: [css3-lists] Opinion on the 'range' descriptor

On Thu, Apr 28, 2011 at 2:30 AM, Alexander Shpack <shadowkin@gmail.com> wrote:
> On Thu, Apr 28, 2011 at 12:52 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>> Right now counter styles have a 'range' descriptor, which defines an
>> explicit range for the style.  Counter styles also have implicit
>> ranges based on their algorithm; for example, numeric styles have an
>> implicit range of [-inf,inf], while alphabetic styles have an implicit
>> range of [1,inf].
>>
>> Hakon observed that there doesn't seem to be a good use-case for
>> explicit ranges on any type except additive, and I think he's probably
>> right.  I can only come up with a single case where it can be useful,
>> as an alternate way to define "fixed-width numeric" styles:
>>
>> @counter-style decimal-fixed-3-1 {
>>  type: override decimal;
>>  range: 0 9;
>>  prefix: '00';
>> }
>>
>> @counter-style decimal-fixed-3-2 {
>>  type: override decimal;
>>  range: 10 99;
>>  prefix: '0';
>>  fallback: decimal-fixed-3-1;
>> }
>>
>> @counter-style decimal-fixed-3 {
>>  type: override decimal;
>>  range: 100 999;
>>  fallback: decimal-fixed-3-2;
>> }
>>
>
> IMO, it's too complicated.
>
> @counter-style decimal-fixed-3 {
>  type: override decimal;
>  overlay: "000";
> }
>
> UA must intersect current counter value and overlays' pattern
>
> 000
> +
> __1
> -------
> 001
>
>
> 000
> +
> _99
> ------
> 099
>
> As simple as possible

I understand that what I described isn't an ideal method for
describing fixed-width numeric counters.  I was just using that as a
possible use-case for explicit ranges.

~TJ

Received on Thursday, 28 April 2011 16:25:08 UTC