-
Notifications
You must be signed in to change notification settings - Fork 757
Description
Read #7661 issue and noticed @tabatkins saying
Also, I think that in general everything people want to achieve with static positioning is achieved better, easier, and more reliably with anchor positioning.
My issue here would be — I don't think an anchored element, currently, has an access to the grid of an element it would be positioned into? In order to utilize the grid with anchor positioning, right now we would need to have actual elements in the grid that we could then use as the target.
But what if we could target specific grid areas?
There are other cases where we could want to “specify” in more details what exactly we're targeting when selecting an anchor, for example, I agree that we would want an ability to target a particular fragment (#8895).
What if we could introduce a new function like grid-area() that could be used for this?
anchor(--foo grid-area(content) center);
anchor(--bar grid-area(1 / span 2) start);This way, for a particular anchor, we would first find the element that is associated with it, then would check if it is a grid, and if so, would try to find the area by the same syntax grid-area uses.
Alternative considered for a second: using the grid-area property itself when the anchor is active, but this won't really work as we could want to have multiple anchors with different grids.