Re: [css3-values] use cases and the design of 'cycle()'

(12/04/25 23:44), L. David Baron wrote:
> On Tuesday 2012-04-10 02:11 +0800, Kang-Hao (Kenny) Lu wrote:
>> While reviewing CSS3 V&U, I realized that 'cycle()' doesn't really solve
>> a use case I thought it would solve.
>>
>> Use Case A: In a User Interface built by nesting elements (say,
>> <table>), set background color on the elements alternatively along the
>> nesting level. See picture[1]
> 
> Yes, it doesn't solve this case alone.  (I've also never seen any
> other examples of this case.)

I agree that this case isn't common, but still, in my situation I never
need B and C.

> It does solve this case in combination with variables, though, and
> I think that's a better solution than making cycle() more complex.
> 
> For example:
> 
>   table {
>     var-cycling-background: cycle(white, gray);
>     background: var(cycling-background);
>   }

This seems like an interesting solution. I don't have objection to keep
the current definition as it it, but I want to mention that after I
realized that 'cycle()' doesn't work with my case I asked about "how do
I do this in CSS?" in a channel of mostly Web developers, a guy did say
"in the future, you can use cycle()".

I guess this is learnable but who knows.


Cheers,
Kenny

Received on Wednesday, 25 April 2012 16:10:51 UTC