Re: [csswg-drafts] [css-anchor-position-1] Using anchor offsets/dimensions for properties apart from inset/sizes (#8586)

Adding a concrete example that fits this broader request.

It would be very useful if `anchor-size()` were allowed in `scroll-padding-*`.

A common case is a sticky header obscuring fragment targets or focused elements (`#hash`, keyboard navigation, `scrollIntoView()`). Today this requires hardcoded values or JS measurement to keep `scroll-padding-top` in sync.

Ideally:

```css
.page-layout__header {
  anchor-name: --header;
}

html {
  scroll-padding-top: anchor-size(--header block);
}
```

This would keep the relationship declarative and avoid JS while helping prevent focus from being visually obscured.

I’ve opened a focused issue for this:
https://github.com/w3c/csswg-drafts/issues/13558


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


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

Received on Wednesday, 25 February 2026 07:00:51 UTC