gss / parser

Constraint Cascading Style Sheets compiler
MIT License
48 stars 6 forks source link

Add 2D sugar for scale #36

Open paulyoung opened 9 years ago

paulyoung commented 9 years ago

I believe scale-x and scale-y will be introduced in v2.1 of the engine.

This pull request allows:

scale: = 1 - number / 10;

as convenience for:

scale-x: = 1 - number / 10;
scale-y: = 1 - number / 10;
Inviz commented 9 years ago

I thought of implementing it as expansion in engine, but i was holding it off as not very important. Another quirk with scale is that it's actually a 3d property and also implies scale-z...

But i like how much more trivial it is in parser.

paulyoung commented 9 years ago

Maybe the 2D unpacker should be made more generic and combine any number of properties.

paulyoung commented 9 years ago

Alternatively:

scale-xy: ["scale-x", "scale-y"]
scale: ["scale-xy", "scale-z"]

:trollface: