oddbird / oddbird/css-anchor-positioning
[BUG] `inset` not overridden correctly in fallbacks
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 493
- Forks
- 18
- Avg merge
- 12h 37m
- Merged PRs (30d)
- 5
Description
Describe the bug
Given
inset: auto;
top: anchor(bottom);
left: anchor(right);
the position-try fallback is created as:
left:var(--anchor-15OcXs-HWJ-Q)!important;
top:revert!important;
bottom:var(--anchor-NFBDsMuRrZSb)!important;
inset:auto!important;
The inset is added after the others, which cascades to override the other values. In addition, top conflicts, and should not be set.
To Reproduce
Create a target with position-try-fallbacks and inset: auto.
Expected behavior
The inset shorthand should work in combination with the other values as expected.
Screenshots
If applicable, add screenshots to help explain your problem.
Browsers tested on
Polyfill v0.5.1
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
Reproduce the issue with a target using position-try-fallbacks and inset: auto, then trace where the position-try fallback CSS is generated. Confirm that the inset shorthand no longer overrides the other fallback values and that the conflicting top declaration is omitted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100