Re: Gradient syntax proposal

On Aug 15, 2009, at 9:38 AM, "Tab Atkins Jr." <jackalmage@gmail.com>  
wrote:

> Restricting yourself to *just* the simple forms doesn't gain you
> anything.  It doesn't make it faster to implement, and it doesn't
> somehow enable an even simpler syntax.  The simple forms are as
> stripped-down as it is possible to be.  You now just have the ability,
> when you need it, to specify things to a greater degree when
> necessary.

So now the argument is "why not?" because the routines to handle  
complexity is already built into the programming code two software  
programs, so we might as well expose that much complexity to authors  
too?

What I am against is adding complexity and confusion to the grammar  
just to serve some extreme edge cases.

There is no compelling reason for there to be more than one keyword or  
angle on the left part. 'top-left' is one such keyword. 'top left' is  
now two, and 'top left to bottom right' is five, all meaning the same  
thing with absolutely NO GAIN. It does not aid in learning to have to  
interpret that instead of a single keyword that means the same thing,  
or to have multiple ways to say the same thing. For instance:

1. linear-gradient(top / green 20% blue 40%)

is the same as all of the following:

2. linear-gradient(0 20% / green, blue 40% )
3. linear-gradient(0 20% to 0 40% / green blue )
4. linear-gradient(0 20% to 0 40% / green 0, blue 0 )
5. linear-gradient(0 0 / green 20%, blue 40% )
6. linear-gradient(0 0 to 0 100% / green 20%, blue 40% )
7. linear-gradient(top left to 0 100% / green 20%, blue 40% )
8. linear-gradient(top left to bottom left / green 20%, blue 40% )
9. linear-gradient(top left to 0 40% / green 20%, blue 100% )
10. linear-gradient(0 0 to left 40% / green 20%, blue 100% )
11. linear-gradient(top to bottom / green 20%, blue 100% )
12. linear-gradient(top to 0 100% / green 20%, blue 40% )
13. linear-gradient(top to bottom left / green 20%, blue 40% )
14. linear-gradient(top to bottom / green 20%, blue 40% )
15. linear-gradient(top left to bottom / green 20%, blue 40% )
16. linear-gradient(top to 0 40% / green 20%, blue 100% )

I'm pretty sure I left some more ways to say the same thing out. And  
this is so far just for the commonest case of going in a direction  
that's a multiple of 90 degrees. It gets worse with other angles added  
to the mix.

Now one can hope that people only use form #1, but they wont. Teaching  
CSS to students will require teaching what each of these means. And  
reading someone else's code means that you could come across any one  
of these forms. And reading someone else's code gets even worse with  
diagonals, where people are using percentages on the left side of the  
slash to mean something different than what the mean on the right side  
of the slash. And adding all this complexity just to service the  
extreme few use cases, which can be achieved nearly the same without  
it? No, thank you. Keep It Simple, Sir.

Received on Saturday, 15 August 2009 18:23:17 UTC