oddbird / oddbird/css-anchor-positioning
Batch DOM checks for fallback positions
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 493
- Forks
- 18
- Avg merge
- 12h 37m
- Merged PRs (30d)
- 5
Description
Per @mmalerba -
"I'm not very familiar with @floating-ui/dom, maybe its doing some intelligent batching already, but if not, its something we could consider doing manually. i.e. add the styles for a new candidate position for every target and then check the overflow of all of them at once, repeat the process for any that don't have a match yet"
https://github.com/oddbird/css-anchor-positioning/pull/202#discussion_r1695787685
This seems like a potential for improved performance, especially when there are multiple anchored elements with position fallback.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the discussion in pull request #202 and inspect how @floating-ui/dom currently handles fallback-position checks for multiple anchored elements. Determine whether batching is absent and define a performance comparison for pages with multiple anchored elements; done means the behavior remains correct while the repeated DOM checks are measurably reduced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100