Re: [csswg-drafts] Proposal: Expose Pointer Position Information on Hovered Elements (#6733)

Starting with `--` would break this promise: https://drafts.csswg.org/css-variables-1/#custom-property

> Custom properties are solely for use by authors and users; CSS will never give them a meaning beyond what is presented here.

Also, sometimes you use `var()` and sometimes `env()`. Environment variables must have the same value everywhere, can't depend on the element.

Then, pseudo-classes are just a way to select elements. They shouldn't which CSS features you can use in these elements.

I don't think there is a clear choice for the coordinates, either. You mention center of the box, but that could even change depending on whether we consider the content area, padding area, border area...

Note that saying that -1 is the left, 0 is the center, and 1 is the right doesn't imply that the range of values is [-1,1]. Because an element can be hovered when the pointer is outside of its border area (in front of an overflowing descendant).

Also, I guess that most usecases would need the sizes of the element. Or want the coordinates with respect to the screen, or the containing block.

Overall, it seems to me that this is better fitted for JS.


-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6733#issuecomment-944620229 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 15 October 2021 19:50:18 UTC