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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 28 Apr 2011 09:24:21 -0700
Message-ID: <BANLkTimuJFEXg8Dm7+qGjimb77-AZ3EUHQ@mail.gmail.com>
To: Alexander Shpack <shadowkin@gmail.com>
Cc: www-style list <www-style@w3.org>
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 GMT

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