-
Notifications
You must be signed in to change notification settings - Fork 49
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
[css-motion] Suggestion that <position> properties not be adjacent in offset shorthand #24
Comments
(Sorry, I didn't allow for Markdown.)
However, Browsers might not follow the author's intent with the following examples.
I'm not aware of any other shorthands or properties allowing two or more positions, other than Perhaps place Alternately, consider including punctuation in the offset shorthand. |
@ericwilligers You made a good point : ) How about
Three of the values in offset shorthand are mandatory: All two of the other values are optional. For example,
Do you have a better suggestion? |
The text for offset shorthand, like the old text for motion shorthand, currently says "Omitted values are set to their initial values." In Chrome I implemented the "motion" shorthand as || || , allowing values to be omitted. Note that the font and background shorthands use / as a separator: The following would be backwards compatible: [ || || ] [ / [ / ]? ]? |
I don't think we should try to support all of the offset-* properties in a single shorthand given the multiple different problems with doing so. Just offset-path, offset-distance and offset-rotation should capture most use cases for now, and we can look at adding the others later (e.g. by using @ewilligers proposed syntax) in a later level. I think it's fine for advanced users to have to set offset-position and offset-anchor separately. (See also #42 ). |
When considering whether things should have a shorthand / longhand relationship, in addition to considering if you want to set them through a single syntax, we should also take into account that the shorthand resets all the long hands anyway. Even if the shorthand does not include any syntax to set one of its longhands to different value, if we expect to do so at some point, the shorthand/longhand pairing should be done now, otherwise we will have a compat problem when trying to do the transition. |
An alternative then might be to add a distinct offset positioning shorthand later, if we ever see demand. Either way I don't think the costs of a more complex syntax outweigh the benefits of a single shorthand at this stage. We have precedent here too, maybe? transform-origin is similar in many ways to offset-position/offset-anchor, and we have no generic transform shorthand. |
Yes, there's precedent, so I don't think we should be constrained. I think the question boils down do whether we want all the properties to be reset when the shorthand is set, or only some. If it is all, we should add them to the shorthand, even if we don't give any syntax (yet) to the shorthand to address them and all it does is set them to the initial value. If not, they should not be part of the shorthand. |
I'm a little concerned about a mixture of spaces and '/'s for separation, which sounds confusing, like the 'font' shorthand (which I still can't remember reliably enough to use :p). I don't have a counter-proposal, just offering some feedback. Do we have any other properties with similar microsyntax needs and how they solved them? |
The position and distance properties are no longer adjacent. The 'auto' properties are also no longer adjacent. The / before was agreed at TPAC.
|
is currently
&& && && &&
where and may both be .
However, can contain from one to four values.
Browsers might not follow the author's intent with the following examples.
I'm not aware of any other shorthands or properties allowing two or more positions, other than and , which each have comma separators.
Perhaps place and/or between the properties, for example
&& && && && .
Then only "top 10%" remains tricky.
Alternately, consider including punctuation in the shorthand.
The text was updated successfully, but these errors were encountered: