mdn / mdn/content

Improve position-try-fallbacks demos

Open
#41,723 2 comments 0 reactions 0 assignees View on GitHub
Content:CSS
Dominant language
Markdown
Stars
11k
Forks
23.2k
Avg merge
2d 9h
Merged PRs (30d)
331

Description

On MDN, we have several places that feature anchor positioning position-try-fallbacks demos:

- https://developer.mozilla.org/en-US/docs/Web/CSS/@position-try
- https://developer.mozilla.org/en-US/docs/Web/CSS/position-try-fallbacks
- https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_anchor_positioning/Try_options_hiding

The issue is that they don't seem to work particularly well. They don't work smoothly in terms of trying all the different fallbacks. They seem buggy.

To improve things, I have written some new demos:

- position-try-fallbacks test with position try keywords: https://codepen.io/Chris-Mills/pen/gbPjWdK
- position-try-fallbacks test with position-area values: https://codepen.io/Chris-Mills/pen/LEGBjRv
- QUESTION: The `bottom left` and `bottom right` fallbacks don't seem to work, and I'm not sure why. Does anyone know?
- position-try-fallbacks test with custom @position-try fallbacks: https://codepen.io/Chris-Mills/pen/xbZJLMv
- QUESTION: The `--custom-bottom-right` and `--custom-top-right` fallbacks don't seem to work, and I'm not sure why. Does anyone know?

The demo can be controlled in the following ways:

- Click the mouse to move the anchor to that position.
- Use the WASD keys to move the anchor top, right, bottom, left.

I'm intending to implement these on the referenced pages, but I'd like some help in figuring out answers to the above questions. Maybe @mfreed7 or @estelle would have some thoughts?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.