Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dual properties shorthand #57

Open
Mouvedia opened this issue Jul 9, 2012 · 3 comments
Open

dual properties shorthand #57

Mouvedia opened this issue Jul 9, 2012 · 3 comments

Comments

@Mouvedia
Copy link
Member

Mouvedia commented Jul 9, 2012

Properties like contentAlignX/contentAlignY or anchorX/anchorY should have a common property.

align: left, top;
//would be equivalent to
alignX: left;
alignY: top;

contentAlign: center;
//would be equivalent to
contentAlignX, contentAlignY: center;
@FSX
Copy link

FSX commented Jul 17, 2012

I think this would be a good addition. This reduces duplication of code in certain cases.

@veosotano
Copy link
Member

I'm against this on the basis that when a property accepts multiple values, it should accept an indefinite amount of values. It's the 0-1-infinity rule. We could consider using an align property which takes something like a @point object. It would look like this:

align: @{ x: left; y: top };
//equivalent to
align.x: left;
align.y: top;
//also equivalent to
align: @{ left; top };

@Mouvedia
Copy link
Member Author

It's not always the case (take the corners property on @Rectangle for instance).

I really think it's something CSS users will miss. We should provide a way to achieve what they want while internally dealing with it (using an object if needed). I am still supporting it because such a shorthand will be expected and covers a basic use case (positioning).

align: <common>;
align: <X>, <Y>;

contentAlign: <common>;
contentAlign: <X>, <Y>;

anchor: <common>;
anchor: <X>, <Y>;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants