oddbird / oddbird/css-anchor-positioning

Improve layout for examples on the demo page

Open
#284 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

demo-site enhancement
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 elements grid 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
  • elements should have sufficient padding to allow for a single absolutely positioned target touching the anchor (or alternatively, is there a way for elements to 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 elements box height

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.