Re: Multiple assignment structure (suggestion)

Yes, but the idea was not to type less!
The idea was to save bytes!
We are always trying and saving bytes by shrinking, minifying, compressing,
etc...
look at reset.css, for example.

Important bytes could be saved, instead of using "var(--main-color);" for
each property!
This is simply code repetition!

Once we can use "selector-1, selector-2", it seems just logic to me, that
we are supposed to do the same with properties!

In JS we can do things like:
x= y= z= "sameValue";

Therefore, uglifiers/minifiers can use this technique to save more
bytes...specially useful in the current "age of mobile access" we live in,
and for big sites(like the one I work on(with about 90 million unique
visitors per month).

Cheers.


On Wed, Nov 26, 2014 at 10:29 PM, Cameron McCormack <cam@mcc.id.au> wrote:

> Tab Atkins Jr. wrote:
>
>> selector 1,
>> selector 2 {
>>    var-main-color: #009;
>>    color: var(main-color);
>>    border-color: var(main-color);
>> }
>>
>
> selector 1,
> selector 2, {
>   --main-color: #009;
>   color: var(--main-color);
>   border-color: var(--main-color);
> }
>
> You changed the syntax, remember. :)
>



-- 
*Felipe N. Moura*
Senior Web Developer

Website:  http://felipenmoura.org
Twitter:    @felipenmoura <http://twitter.com/felipenmoura>
LinkedIn: http://goo.gl/qGmq

Meet some of my projects:
BrazilJS Conference <http://braziljs.com.br/>  |  BrazilJS Foundation
<http://braziljs.org>  |  Power Polygon
<http://github.com/braziljs/power-polygon>  |  TheWebMind
<http://thewebmind.org/>  |  PHPDevBar
<https://addons.mozilla.org/pt-BR/firefox/addon/php-developer-toolbar/>
---------------------------------
LinuxUser #508332
*Changing  the  world*  is the least I expect from  myself!

Received on Thursday, 27 November 2014 02:05:22 UTC