oddbird / oddbird/css-anchor-positioning
Improve layout for examples on the demo page
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 493
- Forks
- 18
- Avg merge
- 12h 37m
- Merged PRs (30d)
- 5
Description
The elements grid area for examples is a bit unwieldy to work within, and has some issues on mobile devices. Based on the examples we now have, I think these changes would be useful-
- The left and right margins aren't needed, especially on narrower screens.
- The
elementsgrid area should scroll left and right, to prevent overflow - This scrolling may need to happen independently of the scroll area that is used for position fallback examples
- The anchor element should be
min-content- it currently is 100% width. - By default, the anchor should be centered within
elements elementsshould have sufficient padding to allow for a single absolutely positioned target touching the anchor (or alternatively, is there a way forelementsto auto-grow so that the content box includes the absolutely positioned targets?)- For cases with multiple anchors, it would be nice to have an easy way to specify the
elementsbox height
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 at the demo page's examples layout and inspect the elements grid, the position-fallback scroll area, and the anchor sizing rules. Compare the current behavior on narrow screens and with multiple anchors, then make the grid scroll independently, center a min-content anchor, remove unnecessary margins, and provide enough padding or configurable height for positioned targets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- design, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100