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

[motion-1] The syntax of "offset" shorthand is out-of-date #515

Open
BorisChiou opened this issue May 31, 2023 · 3 comments
Open

[motion-1] The syntax of "offset" shorthand is out-of-date #515

BorisChiou opened this issue May 31, 2023 · 3 comments
Labels

Comments

@BorisChiou
Copy link

After the updating of offset-position and offset-path, we have the offset transform (and create stacking context) only when offset-path is not none. offset-position is used only when offset-path functions don't specify the offset starting position.

So the current syntax of offset shorthand is out-of-date.

[ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]?

The exclamation point (!) doesn't make sense now. It's not necessary to have offset-position if we don't specify offset-path. Perhaps we should always specify offset-path, and move offset-position together with offset-anchor or other places?

@SebastianZ
Copy link
Contributor

@BorisChiou It looks like browsers ended up implementing the current syntax. So it's probably too late to move <'offset-position'> together with <'offset-anchor'>. Though maybe an HTTP archive check could proof the opposite.

Do I understand you correctly that you want to change the syntax to the following?

<'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? [ / [ <'offset-anchor'> || <'offset-position'> ]?

Sebastian

@BorisChiou
Copy link
Author

BorisChiou commented Jan 9, 2024

Yeah! The syntax you provided,

<'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? [ / [ <'offset-anchor'> || <'offset-position'> ]?

looks much better than the original one because offset-position is ignored if we don't have an valid offset-path.

The design idea of the current shorthand syntax is because offset-position may create a stacking context, and it could be used independently. However, we change its meaning in 2023 but we probably forgot to change the shorthand at the same time.

@SebastianZ
Copy link
Contributor

Ok, so this needs a check for whether the change is web-compatible, then. https://chromestatus.com/metrics/css/timeline/popularity/543 indicates a quickly growing percentage of pages using offset.

Anyone able to do a more granular HTTP Archive query to get numbers on this?
What's needed is a check on usages of <'offset-position'> value usages in the offset shorthand property, or more precisely, the combination <'offset-position'> <'offset-path'>.

Sebastian

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

No branches or pull requests

2 participants