- From: Mikko Tapionlinna via GitHub <noreply@w3.org>
- Date: Wed, 25 Feb 2026 07:00:50 +0000
- To: public-css-archive@w3.org
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