Re: Add margin-x and margin-y properties (same for padding and border-*)

(12/01/16 10:17), Alan Gresley wrote:
> So how does this overrule default margins [1] on block level elements
> or overrule the property 'margin'?

As far as I can tell, margin-x/y are just shorthand properties (margin-x
for margin-left/right, margin-y for margin-top/bottom) so the overriding
rule seems quite clear. Can you make an example that this is not the case?

>
> May I suggest this.
>
>   .example { margin: y(1em); }
>
>   .general       { margin: 1em 20px; }
>   .general.lorem { margin: y(2em); }
>   .general.ipsum { margin: y(3em); }

My take is an 'initial'/'inherit'-like keyword that means "ignore this
value", so

.example { margin: 1em _ ; }

.general { margin: 1em 20px; }
.general { margin: 2em _ ; }
.general { margin: 3em _ ; }

I am not sure if '_' is already reserved for vendor extension. This
keyword is meant to be just syntactic sugar so { display: block;
display: _ ; } would just be { display: block; } as if the whole
declaration is dropped. Not sure how this keyword works for other
shorthand properties though. (Not to mention that I am not too convinced
that this is too important a problem we should address.)


Cheers,
Kenny

Received on Monday, 16 January 2012 13:21:40 UTC