Skip to content

[css-transforms-2] Syntax of "rotate" judged unintuitive (and not interoperable anyway) #1269

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

Closed
FremyCompany opened this issue Apr 21, 2017 · 8 comments

Comments

@FremyCompany
Copy link
Contributor

It seems Chrome doesn't support the syntax of rotate: 0 0 1 45deg. Interestingly, Edge does not either but supports rotate: 45deg 0 0 1 instead.

Discussing with devs on Twitter, devs thought the current syntax is not clear:

  • what are those three numbers?
  • can you put the angle between them?
  • are they related in any way?

Maybe we should change the syntax to make the grouping clearer, and also allow to reorder. An idea would be rotate: 45deg axis(0 0 1).

Thoughts?

@fantasai
Copy link
Collaborator

Alternately, have longhands rotate-axis and rotate-angle and then it's more obvious?

@fantasai
Copy link
Collaborator

Then you have rotate: <'rotate-axis'> || <'rotate-angle'>

@FremyCompany
Copy link
Contributor Author

I like it

@FremyCompany FremyCompany removed the css-transforms-1 Current Work label May 13, 2017
@ewilligers
Copy link
Contributor

It seems Chrome doesn't support the syntax of rotate: 0 0 1 45deg

This was fixed.

Web platform tests show the currently valid and invalid syntax.

I don't think having two properties and a shorthand is justified. Fremy's example could be achieved with
Value: none | <angle> && [ axis(<number>{3}) ]?

@AmeliaBR
Copy link
Contributor

AmeliaBR commented Feb 6, 2018

Hmmm... this issue overlaps with #2130, which is also discussing the syntax of the rotate property.

As I mentioned over there, I think that the order of angle vs axis should be flexible, so long as unitless 0 is not allowed for the angle (as agreed in #2116).

I personally don't think the function notation is necessary for grouping the axis vector values, but I don't have a problem with it. It is neater than any other solution.

Splitting the property into longhands is probably something that could wait until we have more real-world feedback. It might turn out that what authors really want are separate rotate-x, rotate-y, rotate-z properties, or something like that.

@tabatkins
Copy link
Member

"I don't know what these three numbers do" seems weird, given the existence of rotate3d(), whose arguments are also an angle and three numbers. The only difference in syntax between the property and the function is whether the items are comma-separated or space-separated.

Maybe just nobody uses rotated3d() in practice, at least by hand?

@dbaron
Copy link
Member

dbaron commented Feb 8, 2018

This issue should be addressed by the discussion the WG just had, recorded in #2130.

@tabatkins
Copy link
Member

Yup, thus closing.

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

6 participants