-
Notifications
You must be signed in to change notification settings - Fork 703
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-anchor-position-1] Using anchor offsets/dimensions for properties apart from inset/sizes #8586
Comments
I would want to copy one use-case from the anchoring to the cursor issue (#8639) here, as if we could use it for background-position or other properties, this would unlock a lot of things for which developers currently have to use JS to assign the mouse coordinates.
|
I did recently play a bit with the transforms, as well as with this hack for working around the absence of the ability to strip units from the calculations. It would be really nice to add at least the This would also unlock an ability to use more dimensions in the transform aside from its element via |
(Retagging to level 2, this is a substantial additional feature to discuss.) |
Disclaimer and additional links
I'm submitting my feedback following my experiments with the current implementation of anchor positioning in Chrome Canary.
I wrote an article about my experiments, but decided to fill most of my feedback as separate issues here.
A quick summary of related links:
In some of my experiments I wanted to use the anchor positions or anchor sizes for properties other than
top
/left
/right
/bottom
/width
/height
.Main experiments that could benefit from this are the ones that draw the connectors between two elements (examples later in this section — https://kizu.dev/anchor-positioning-experiments/#the-technique-itself) — ability to use the diff between two anchor's positions would result in ability to calculate the angle between them, leading to a lot of potential in terms of possible decorative things we could do with them.
In my experiments I ended up just using SVG, as it kinda supports doing that kind of directional stuff, but I can imagine a lot of other possible appliances for using anchor values not just for positioning the element & setting its dimensions —
background-size
,background-position
, gradient stops,transform
, maybe some other properties — all of them could benefit from an ability to retrieve the anchor's values.Possible cases: drawing shadows, reflections, glares based on other elements' positions, for example. Currently this could be kinda done by using elements for each such decorative item, but sometimes it could be much more effective to use multiple backgrounds, and use separate layers for separate elements.
The text was updated successfully, but these errors were encountered: