#CSSNaming

westbrookwestbrook
2024-06-25

Now that CSS Anchor Positioning allows us to "name a reference" in CSS, do we need being able to consume the value of `:nth-child` or similar when naming things?

Something like:

a {
anchor-name: --link-${indexOf};
}

So we could anchor to ANY `<a>` on a page without needing to explicitly give each one of those an `anchor-name`?

I don't much know the View Transitions API, but maybe it could benefit from similar?

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst